securechicken / homebridge-micronova-agua-iot-stove

Homebridge plugin to manage stoves/heaters with Micronova's Agua IOT module and HTTP API
GNU Affero General Public License v3.0
6 stars 3 forks source link

Jolly Mec - Calculate Stove Status Error #3

Closed Slavitacus closed 3 years ago

Slavitacus commented 3 years ago

Environment and Input

Item Your information
Homebridge Version 1.3.3
Plugin version v0.0.1-beta.1
Stove brand/mobile app name Jolly Mec
iOS version N/A

Bug description

Expected function and references

I have this error come very often :

[3/14/2021, 2:21:54 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache status_get => 11 [3/14/2021, 2:21:54 PM] [Poêle Chalet Taroko] _calculateStoveStatus (false) has no map key for value: 11 [3/14/2021, 2:21:54 PM] [homebridge-micronova-agua-iot-stove] This plugin generated a warning from the characteristic 'Active': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://git.io/JtMGR for more info. [3/14/2021, 2:21:54 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues Active: 11 => null, (ERR: null) [3/14/2021, 2:21:54 PM] [Poêle Chalet Taroko] _calculateStoveStatus (true) has no map key for value: 11 ....... [3/14/2021, 2:22:03 PM] [Poêle Chalet Taroko] _calculateStoveStatus (false) has no map key for value: 11 [3/14/2021, 2:22:03 PM] [Poêle Chalet Taroko] _calculateStoveStatus (true) has no map key for value: 11

Bug

Steps to Reproduce

1.

  1. ...

Resolution paths

Ideas

Possible Implementation

securechicken commented 3 years ago

Thanks. Reading stoves status registers was expected to bring a value between 0 and 9 only. It seems your stove also has a "11" value, and maybe others values as well. Will fix the error, but more importantly, I would like to be able to associate this "11" value with one of the 3 status that HomeKit is understanding (INACTIVE, IDLE, or HEATING).

What is you stove doing/in which precise state it is (ON or OFF, heating or not, during ignition or shutdown or regular working... anything will be useful), when this error happens in Homebridge?

Slavitacus commented 3 years ago

Okay, I think this append when the stove is in eco mode (it have reach the target temperature). Maybe it’s connect to an other problem I found, the fan setting from the app Home, and the fan setting from the remote are not well set: The stove have 6 speeds : Eco (when it have reach the temperature set), Silence (fan super slow), 1, 2, 3, 4 and 5 if I change the fan setting from the Home app to the remote and the stove will show : 0=off; 1=1; 2=2; 3=3; 4=4; 5=5. If I change from remote, the Home app will show : Silence=2; 1=1; 2=2; 3=3; 4=4; 5=5 and Eco, I dont Know... I'll check leater, I just swith off the stove testing the speed from Home app

securechicken commented 3 years ago

I think this append when the stove is in eco mode (it have reach the target temperature).

And is the stove still heating (active fans and/or flame) when so, or is it idle (no flame, no fans)? I'll need to know to map the correct HomeKit state to this value.

Maybe it’s connect to an other problem I found, the fan setting from the app Home, and the fan setting from the remote are not well set:

No that's definitely independent and simple: the stove/API send a "status" value that the plugin does not understand for now, so the plugin reports the fact that it cannot handle the value as an error.

The stove have 6 speeds : Eco (when it have reach the temperature set), Silence (fan super slow), 1, 2, 3, 4 and 5 if I change the fan setting from the Home app to the remote and the stove will show : 0=off; 1=1; 2=2; 3=3; 4=4; 5=5. If I change from remote, the Home app will show : Silence=2; 1=1; 2=2; 3=3; 4=4; 5=5 and Eco, I dont Know... I'll check leater, I just swith off the stove testing the speed from Home app

I'm not sure I get this well - but this would be a separate issue, not actually linked to this one. The fan rotation setting that this plugin can set and understand is supposed to be the stove fan(s) power (usually associated to a flame intensity power by the stove). It goes from 1 to 4 or more, depending on stoves brands and models. The plugin is reporting REAL current power to HomeKit/Homebridge, not the user set power, as both can be different. For instance my stove has a "SILENT/QUIET" mode, which will turn all fans off, and set the flame power to "2", regardless of the power I set (on stove directly with buttons, or in official stove app) - the plugin/HomeKit app will report "2", because the real current power is actually 2, and not what is set on the stove or in stove official app. My stove also has an "ENERGY SAVING" mode, where it is heating at set power until a target temperature is reached, and then lower the power automatically until a top temperature (equals to target temperature + hysteresis) is reached. As the power is automatically lowered when target temperature is reached, then even if I set my power to "3" (on stove or in stove official app), the stove will at some point automatically go to power "2" (or even "1"), and the plugin/HomeKit will as so report this real power, not the set "3". This can be changed, but I actually preferred to have the real power reported, as it actually allowed me to monitor stove activity more precisely with HomeKit. I however recognise this can be confusing - but as soon as the stove will quit its special/automatic mode or stop heating, the reported power should be the same than the user set power (so identical in HomeKit, stove official app, and stove itself). Also, if you change power in HomeKit, even while the stove is working in a special/automatic mode, the power change will be taken into account correctly - but then just after, if your stove is still in an automatic/special mode, the HomeKit slider will go back to the real current power of the stove (which can be lower than what you just set).

Slavitacus commented 3 years ago

Okay, I think I got it...

I made a table for the fan speed / stove power, I'll put it in a separate issue.

Concerning this one, I'll check the logs and come back to you when it apear again....

Thanks

Slavitacus commented 3 years ago

Okay,

It seems this issue apear when the stove is in stanby:

[3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister status_get: {"_v":10,"reg_type":"GET","offset":33,"formula":"#","formula_inverse":"#","format_string":"{0}","set_min":0,"set_max":50,"mask":65535,"_offv":0} [3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache status_get => 10 [3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] _calculateStoveStatus (false) has no map key for value: 10 [3/14/2021, 9:01:56 PM] [homebridge-micronova-agua-iot-stove] This plugin generated a warning from the characteristic 'Active': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://git.io/JtMGR for more info. [3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues Active: 10 => null, (ERR: null) [3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] _calculateStoveStatus (true) has no map key for value: 10 [3/14/2021, 9:01:56 PM] [homebridge-micronova-agua-iot-stove] This plugin generated a warning from the characteristic 'Current Heater-Cooler State': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://git.io/JtMGR for more info. [3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues CurrentHeaterCoolerState: 10 => null, (ERR: null) [3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister temp_air_get: {"_v":45,"reg_type":"GET","offset":20,"formula":"#/2","formula_inverse":"#*2","format_string":"{0}°C","set_min":7,"set_max":40,"mask":65535} [3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache temp_air_get => 22.5 [3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues CurrentTemperature: 22.5, (ERR: null) [3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister temp_air_set: {"_v":42,"reg_type":"SET","offset":32875,"formula":"#/2","formula_inverse":"#*2","format_string":"{0}°C","set_min":7,"set_max":40,"mask":65535} [3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache temp_air_set => 21 [3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues HeatingThresholdTemperature: 21, (ERR: null) [3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister real_power_get: {"_v":1,"reg_type":"GET","offset":69,"formula":"#","formula_inverse":"#","format_string":"{0}","set_min":0,"set_max":5,"mask":255} [3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache real_power_get => 1 [3/14/2021, 9:01:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues RotationSpeed: 1, (ERR: null)

[3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] [DEBUG] _waitForRegistersDataReadJobResult updated stove registers from API [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister status_get: {"_v":10,"reg_type":"GET","offset":33,"formula":"#","formula_inverse":"#","format_string":"{0}","set_min":0,"set_max":50,"mask":65535,"_offv":0} [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache status_get => 10 [3/14/2021, 9:15:50 PM] [homebridge-micronova-agua-iot-stove] This plugin generated a warning from the characteristic 'Active': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://git.io/JtMGR for more info. [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues Active: 10 => null, (ERR: null) [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] _calculateStoveStatus (false) has no map key for value: 10 [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] _calculateStoveStatus (true) has no map key for value: 10 [3/14/2021, 9:15:50 PM] [homebridge-micronova-agua-iot-stove] This plugin generated a warning from the characteristic 'Current Heater-Cooler State': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://git.io/JtMGR for more info. [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues CurrentHeaterCoolerState: 10 => null, (ERR: null) [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister temp_air_get: {"_v":45,"reg_type":"GET","offset":20,"formula":"#/2","formula_inverse":"#*2","format_string":"{0}°C","set_min":7,"set_max":40,"mask":65535} [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache temp_air_get => 22.5 [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues CurrentTemperature: 22.5, (ERR: null) [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister temp_air_set: {"_v":42,"reg_type":"SET","offset":32875,"formula":"#/2","formula_inverse":"#*2","format_string":"{0}°C","set_min":7,"set_max":40,"mask":65535} [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache temp_air_set => 21 [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues HeatingThresholdTemperature: 21, (ERR: null) [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister real_power_get: {"_v":1,"reg_type":"GET","offset":69,"formula":"#","formula_inverse":"#","format_string":"{0}","set_min":0,"set_max":5,"mask":255} [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache real_power_get => 1 [3/14/2021, 9:15:50 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues RotationSpeed: 1, (ERR: null) [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister real_power_get: {"_v":1,"reg_type":"GET","offset":69,"formula":"#","formula_inverse":"#","format_string":"{0}","set_min":0,"set_max":5,"mask":255} [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache real_power_get => 1 [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData called, apiStoveRegistersSet=true, apiPendingReadJob=false [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData will do nothing, cache is up to date [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues did nothing (cache OK or job pending) [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister temp_air_set: {"_v":42,"reg_type":"SET","offset":32875,"formula":"#/2","formula_inverse":"#*2","format_string":"{0}°C","set_min":7,"set_max":40,"mask":65535} [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache temp_air_set => 21 [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData called, apiStoveRegistersSet=true, apiPendingReadJob=false [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData will do nothing, cache is up to date [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues did nothing (cache OK or job pending) [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister status_get: {"_v":10,"reg_type":"GET","offset":33,"formula":"#","formula_inverse":"#","format_string":"{0}","set_min":0,"set_max":50,"mask":65535,"_offv":0} [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache status_get => 10 [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] _calculateStoveStatus (true) has no map key for value: 10 [3/14/2021, 9:15:56 PM] [homebridge-micronova-agua-iot-stove] This plugin generated a warning from the characteristic 'Current Heater-Cooler State': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://git.io/JtMGR for more info. [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData called, apiStoveRegistersSet=true, apiPendingReadJob=false [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData will do nothing, cache is up to date [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues did nothing (cache OK or job pending) [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister status_get: {"_v":10,"reg_type":"GET","offset":33,"formula":"#","formula_inverse":"#","format_string":"{0}","set_min":0,"set_max":50,"mask":65535,"_offv":0} [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache status_get => 10 **[3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] _calculateStoveStatus (false) has no map key for value: 10** [3/14/2021, 9:15:56 PM] [homebridge-micronova-agua-iot-stove] This plugin generated a warning from the characteristic 'Active': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://git.io/JtMGR for more info. [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData called, apiStoveRegistersSet=true, apiPendingReadJob=false [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData will do nothing, cache is up to date [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues did nothing (cache OK or job pending) [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister temp_air_get: {"_v":45,"reg_type":"GET","offset":20,"formula":"#/2","formula_inverse":"#2","format_string":"{0}°C","set_min":7,"set_max":40,"mask":65535} [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache temp_air_get => 22.5 [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData called, apiStoveRegistersSet=true, apiPendingReadJob=false [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData will do nothing, cache is up to date [3/14/2021, 9:15:56 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues did nothing (cache OK or job pending) [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister real_power_get: {"_v":1,"reg_type":"GET","offset":69,"formula":"#","formula_inverse":"#","format_string":"{0}","set_min":0,"set_max":5,"mask":255} [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache real_power_get => 1 [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData called, apiStoveRegistersSet=true, apiPendingReadJob=false [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData will do nothing, cache is up to date [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues did nothing (cache OK or job pending) [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister temp_air_set: {"_v":42,"reg_type":"SET","offset":32875,"formula":"#/2","formula_inverse":"#2","format_string":"{0}°C","set_min":7,"set_max":40,"mask":65535} [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache temp_air_set => 21 [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData called, apiStoveRegistersSet=true, apiPendingReadJob=false [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData will do nothing, cache is up to date [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues did nothing (cache OK or job pending) [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister status_get: {"_v":10,"reg_type":"GET","offset":33,"formula":"#","formula_inverse":"#","format_string":"{0}","set_min":0,"set_max":50,"mask":65535,"_offv":0} [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache status_get => 10 [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] _calculateStoveStatus (true) has no map key for value: 10 [3/14/2021, 9:15:57 PM] [homebridge-micronova-agua-iot-stove] This plugin generated a warning from the characteristic 'Current Heater-Cooler State': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://git.io/JtMGR for more info. [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData called, apiStoveRegistersSet=true, apiPendingReadJob=false [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData will do nothing, cache is up to date [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues did nothing (cache OK or job pending) [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister status_get: {"_v":10,"reg_type":"GET","offset":33,"formula":"#","formula_inverse":"#","format_string":"{0}","set_min":0,"set_max":50,"mask":65535,"_offv":0} [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache status_get => 10 [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] _calculateStoveStatus (false) has no map key for value: 10 [3/14/2021, 9:15:57 PM] [homebridge-micronova-agua-iot-stove] This plugin generated a warning from the characteristic 'Active': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://git.io/JtMGR for more info. [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData called, apiStoveRegistersSet=true, apiPendingReadJob=false [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData will do nothing, cache is up to date [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues did nothing (cache OK or job pending) [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegister temp_air_get: {"_v":45,"reg_type":"GET","offset":20,"formula":"#/2","formula_inverse":"#*2","format_string":"{0}°C","set_min":7,"set_max":40,"mask":65535} [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _getStoveRegisterValueFromCache temp_air_get => 22.5 [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData called, apiStoveRegistersSet=true, apiPendingReadJob=false [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateAPIRegistersData will do nothing, cache is up to date [3/14/2021, 9:15:57 PM] [Poêle Chalet Taroko] [DEBUG] _updateCharacteristicsValues did nothing (cache OK or job pending)

securechicken commented 3 years ago

Status values from 10 to 12, that were not handled by plugin before, will be added in next package update with corresponding HomeKit state "IDLE".