arachnetech / homebridge-mqttthing

A plugin for Homebridge allowing the integration of many different accessory types using MQTT.
Apache License 2.0
466 stars 104 forks source link

Swing Mode is reporting as 'undefined', MQTT Explorer is showing correct value on configured topic #564

Closed piejanssens closed 1 year ago

piejanssens commented 2 years ago

HomeBridge log:

[6/7/2022, 2:22:08 PM] [homebridge-mqttthing] This plugin generated a warning from the characteristic 'Swing Mode': characteristic value expected valid finite number and received "undefined" (undefined). See https://homebridge.io/w/JtMGR for more info.

MQTT Explorer: Schermafbeelding 2022-06-07 om 14 25 52

homebridge-mqttthing config:

        {
            "type": "heaterCooler",
            "name": "Hi Sense AC",
            "url": "mqtt://xxx:1883",
            "logMqtt": true,
            "topics": {
                "getCurrentHeaterCoolerState": "hisense_ac/ca2c4f5f18c3/t_work_mode/status",
                "setTargetHeaterCoolerState": "hisense_ac/ca2c4f5f18c3/t_work_mode/command",
                "getCurrentTemperature": {
                    "topic": "hisense_ac/ca2c4f5f18c3/f_temp_in/status",
                    "apply": "return parseFloat(message)"
                },
                "getTargetTemperature": "hisense_ac/ca2c4f5f18c3/t_temp/status",
                "setTargetTemperature": "hisense_ac/ca2c4f5f18c3/t_temp/command",
                "getRotationSpeed": {
                    "topic": "hisense_ac/ca2c4f5f18c3/t_fan_speed/status",
                    "apply": "return message === 'auto' ? 50 : 20 * ['lower','low','medium','high','higher'].indexOf(message);"
                },
                "setRotationSpeed": {
                    "topic": "hisense_ac/ca2c4f5f18c3/t_fan_speed/command",
                    "apply": "return ['lower','low','medium','high','higher'][parseInt(message/20 - 1)];"
                },
                "getSwingMode": "hisense_ac/ca2c4f5f18c3/t_fan_power/status",
                "setSwingMode": "hisense_ac/ca2c4f5f18c3/t_fan_power/command",
                "getTemperatureDisplayUnits": "hisense_ac/ca2c4f5f18c3/t_temptype/status",
                "setTemperatureDisplayUnits": "hisense_ac/ca2c4f5f18c3/t_temptype/command"
            },
            "currentHeaterCoolerValues": [
                "off",
                "off",
                "heat",
                "cool"
            ],
            "swingModeValues": [
                "off",
                "on"
            ],
            "temperatureDisplayUnitsValues": [
                "celsius",
                "fahrenheit"
            ],
            "minTemperature": 18,
            "maxTemperature": 24,
            "restrictHeaterCoolerState": [
                0
            ],
            "accessory": "mqttthing"
        }
ldellus commented 2 years ago

Hello,

I have the same problem. Did you find a solution?

Cheers,

Laurent

arachnetech commented 2 years ago

What is being published to hisense_ac/ca2c4f5f18c3/t_fan_power/status? It looks like it should be just the text off or on from your config.

piejanssens commented 2 years ago

@arachnetech Yes, indeed. Do I need to transform it to strings 'ENABLED' and 'DISABLED'?

arachnetech commented 2 years ago

No, on or off should be fine as you've configured that in swingModeValues. Odd. I'll try to reproduce if I get time.

arachnetech commented 1 year ago

Should be fixed in v1.1.44.