-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Hi developers,
I'm facing an issue using a custom device with a "Mode" capability and Python SinricPro SDK 3.1.1.
Whenever I try to update the given mode from SinricPro Dashboard or the iOS App, this message appears on the dashboard:
Message signature mismatched. It's likely your AppSecret is incorrect.
The issue does not happen when updating the on/off state or the temperature setpoint, only happens for Mode or Range capabilities.
The device has these capabilities:
The Mode capability has these settings:
The callback function:
async def on_mode_state(value: Any) -> bool:
global last_combustion_power
log = logging.getLogger()
log.info('device_id: {} set mode: {}'.format(THERMOSTAT_ID, value))
if value in ("P1", "P2", "P3", "P4", "P5", "P6", "AUTO"):
last_combustion_power = value
return True
return FalseHacking the callback function to also expose the instance id (as in ESP8266/ESP32 SDK):
async def on_mode_state(value: Any) -> bool:
global last_combustion_power
log = logging.getLogger()
# Inspect instance id from callstack
instance = None
try:
stack = inspect.stack()
frame = next(s for s in stack if s.function == 'handle_request').frame
instance = frame.f_locals.get('request').instance
except:
pass # couldn't find handle_request
if instance:
log.info('device_id: {} set mode: {} = {}'.format(THERMOSTAT_ID, instance, value))
else:
log.info('device_id: {} set mode: {}'.format(THERMOSTAT_ID, value))
if value in ("P1", "P2", "P3", "P4", "P5", "P6", "AUTO"):
last_combustion_power = value
return True
return FalsePython app logs:
dic 22 22:33:38 raspi-lasian pysinricpro[3997]: 2025-12-22 22:33:38,298 - websockets.client - DEBUG - > platform: Python
dic 22 22:33:38 raspi-lasian pysinricpro[3997]: 2025-12-22 22:33:38,301 - websockets.client - DEBUG - > SDKVersion: 3.1.1
dic 22 22:33:38 raspi-lasian pysinricpro[3997]: 2025-12-22 22:33:38,304 - websockets.client - DEBUG - > User-Agent: Python/3.11 websockets/15.0.1
...
dic 22 22:34:18 raspi-lasian pysinricpro[3997]: 2025-12-22 22:34:18,862 - websockets.client - DEBUG - > PING 4a ac 0b 86 [binary, 4 bytes]
dic 22 22:34:18 raspi-lasian pysinricpro[3997]: 2025-12-22 22:34:18,870 - websockets.client - DEBUG - % sent keepalive ping
dic 22 22:34:18 raspi-lasian pysinricpro[3997]: 2025-12-22 22:34:18,965 - websockets.client - DEBUG - < PONG 4a ac 0b 86 [binary, 4 bytes]
dic 22 22:34:18 raspi-lasian pysinricpro[3997]: 2025-12-22 22:34:18,970 - websockets.client - DEBUG - % received keepalive pong
dic 22 22:34:37 raspi-lasian pysinricpro[3997]: 2025-12-22 22:34:37,078 - websockets.client - DEBUG - < TEXT '{"header":{"payloadVersion":2,"signatureVersion...g8XxJrIz5APjZ24nXlM="}}' [373 bytes]
dic 22 22:34:37 raspi-lasian pysinricpro[3997]: 2025-12-22 22:34:37,121 - root - INFO - device_id: 6949********a61c set mode: CombustionPower = AUTO
dic 22 22:34:37 raspi-lasian pysinricpro[3997]: 2025-12-22 22:34:37,128 - websockets.client - DEBUG - > TEXT '{"header": {"payloadVersion": 2, "signatureVers...Q5i8IglrNjEq9kCK/xw="}}' [416 bytes]
dic 22 22:34:38 raspi-lasian pysinricpro[3997]: 2025-12-22 22:34:38,867 - websockets.client - DEBUG - > PING 15 e7 15 f0 [binary, 4 bytes]
dic 22 22:34:38 raspi-lasian pysinricpro[3997]: 2025-12-22 22:34:38,874 - websockets.client - DEBUG - % sent keepalive ping
dic 22 22:34:38 raspi-lasian pysinricpro[3997]: 2025-12-22 22:34:38,962 - websockets.client - DEBUG - < PONG 15 e7 15 f0 [binary, 4 bytes]
SinricPro portal log:
Also (probably unrelated), when updating the given mode from the Python application side, an unexpected state of "garage door was closed" is displayed on the dashboard:
Code:
if combustionPower != last_combustion_power:
log.info('device_id: {} set combustion power: {}'.format(THERMOSTAT_ID, combustionPower)) # "AUTO"
success = await device.send_mode_event(combustionPower)
if success:
log.debug("[Event] OK send_event")
last_combustion_power = combustionPower
else:
log.warning("[Event] Failed to send_event")Log:
2025-12-22 22:59:01,787 - root - INFO - device_id: 6949********a61c set combustion power: AUTO
2025-12-22 22:59:01,787 - root - DEBUG - [Event] OK send_event
Display:
