M gateway somehow stopped receiving my temp/hum sensors. So I investigated. When I click on one of my buttons (v1), the pimatic log shows, the message is received:
11:05:00.661 [pimatic-aqara] debug: Subdevice {
11:05:00.661 [pimatic-aqara] debug:> domain: null,
11:05:00.661 [pimatic-aqara] debug:> _events: { report: [Function] },
11:05:00.661 [pimatic-aqara] debug:> _eventsCount: 1,
11:05:00.661 [pimatic-aqara] debug:> _maxListeners: undefined,
11:05:00.661 [pimatic-aqara] debug:> _sid: '158d00020f4950',
11:05:00.661 [pimatic-aqara] debug:> _type: 'button',
11:05:00.661 [pimatic-aqara] debug:> _voltage: 3052,
11:05:00.661 [pimatic-aqara] debug:> _state: 'click',
11:05:00.661 [pimatic-aqara] debug:> _action: true }
But in the frontend, the button device logs “Unknown”. And after a short while pimatic will log this error ( I also got this before v0.3):
Unhandled rejection Error: unknown state=""!
When I manually trigger the temp/hum sensor (with the button on it), I also get received result in pimatic log:
11:07:39.492 [pimatic-aqara] debug: Subdevice {
11:07:39.492 [pimatic-aqara] debug:> domain: null,
11:07:39.492 [pimatic-aqara] debug:> _events: { report: [Function] },
11:07:39.492 [pimatic-aqara] debug:> _eventsCount: 1,
11:07:39.492 [pimatic-aqara] debug:> _maxListeners: undefined,
11:07:39.492 [pimatic-aqara] debug:> _sid: '158d0001dcc362',
11:07:39.492 [pimatic-aqara] debug:> _type: 'temperature',
11:07:39.492 [pimatic-aqara] debug:> _voltage: 2975,
11:07:39.492 [pimatic-aqara] debug:> _state: null,
11:07:39.492 [pimatic-aqara] debug:> _action: false,
11:07:39.492 [pimatic-aqara] debug:> _temperature: null,
11:07:39.492 [pimatic-aqara] debug:> _pressure: null,
11:07:39.492 [pimatic-aqara] debug:> _humidity: null }
11:07:39.499 [pimatic-aqara] debug: Subdevice {
11:07:39.499 [pimatic-aqara] debug:> domain: null,
11:07:39.499 [pimatic-aqara] debug:> _events: { report: [Function] },
11:07:39.499 [pimatic-aqara] debug:> _eventsCount: 1,
11:07:39.499 [pimatic-aqara] debug:> _maxListeners: undefined,
11:07:39.499 [pimatic-aqara] debug:> _sid: '158d0001dcc362',
11:07:39.499 [pimatic-aqara] debug:> _type: 'temperature',
11:07:39.499 [pimatic-aqara] debug:> _voltage: 2975,
11:07:39.499 [pimatic-aqara] debug:> _state: null,
11:07:39.499 [pimatic-aqara] debug:> _action: false,
11:07:39.499 [pimatic-aqara] debug:> _temperature: null,
11:07:39.499 [pimatic-aqara] debug:> _pressure: null,
11:07:39.499 [pimatic-aqara] debug:> _humidity: null }
As you can see, all values are “null”.
When I restart the gateway (plug out/in) it’s the same. When I restart pimatic, it’s the same.
When I pull the plugin manually and revert to v.2.0.13 it’s working again. So I checked the commits and I think this one isn’t working for me: https://github.com/sweebee/pimatic-aqara/commit/7be6614d8d28c96809cba12cf4d903d962a538ce
Maybe this is only working for sensors v2 ?