Ok again I need some help. This time it is with a in-wall, mains powered, zwave dimmer switch that is a device in Homeseer and I am trying to control via MQTT.
Pertinent information is as follows:
HASSOS: 4.12
Home Assistant Core: 0.114.0
Platform: Raspberry Pi 3 B+
Mosquitto MQTT add-on: 5.1
Node-Red add-on: 7.0.0
configuration.yaml contains the following line
light: !include lights.yaml
In my lights.yaml file I have the following two tries at this:
# Dining Room Light Switch
# Homeseer Node: 13
# Ref ID: 28 Name: Dining Room Light
- platform: mqtt
schema: template
name: "Dining Room Light"
unique_id: "DiningRoomLight"
state_topic: "CRUD-06/mcsMQTT/Dining_Room/Lighting/Dining_Room_Light"
command_topic: "CRUD-06/mcsMQTT/Dining_Room/Lighting/Dining_Room_Light/Control"
command_on_template: '{{ "99" | replace("99","on") }}'
command_off_template: '{{ "0" | replace("0","off") }}'
brightness_template: '{{ range(1,98) }}'
qos: 0
optimistic: false
# Kitchen Light 1
# Homeseer Node: 37
# Ref ID: 1086 Name: Kitchen Light 1
- platform: mqtt
name: "Kitchen Light 1"
payload_on: "99"
payload_off: "0"
unique_id: "KitchenLight1"
brightness_scale: "99"
on_command_type: brightness
brightness_state_topic: "CRUD-06/mcsMQTT/Kitchen/Lighting/Kitchen_Light_1"
brightness_command_topic: "CRUD-06/mcsMQTT/Kitchen/Lighting/Kitchen_Light_1/Control"
state_topic: "CRUD-06/mcsMQTT/Kitchen/Lighting/Kitchen_Light_1"
command_topic: "CRUD-06/mcsMQTT/Kitchen/Lighting/Kitchen_Light_1/Control"
optimistic: false
In the 2nd instance of the above for “Kitchen Light 1”, the switch in the UI that is displayed so you can control the light for on and off works. If I use the slider provided in the pop-up it is not co-ordinated. I can control brightness but the switch state is not co-ordinated. Therefore if I set the slider to say 50% brightness it physically sets the light to 50% the light bulb icon shows a “dimmed” version, but the switch in the UI shows off. If I slide the slider all the way down it never goes to “0” which would be off and if I slide it all the way up to “99” then the UI switch state changes to on.
So the 1st instance above for “Dining Room Light” was my attempt to try and get a co-ordination between the brightness and on/off states in the UI. I get a different icon for the on/off states. I get a lightning bolt instead of the simple slider switch. I can turn the light on and off but I cannot set a “dim” or “brightness” setting. The slider in the popup is not co-ordinated with the switch state. In testing from a light off state (both physically and in the UI) I set the slider to 50. The light comes on to full brightness (99). If I move the slider to “0” nothing happens. If I use the icons to turn the light off it turns off.
Homeseer publishes the following:
“0” for both control and status = off
values of 1 to 98 for both control and status = dim or brightness
“99” for both control and status = on
there is one other control status pair it is:
“255” which equals “Last” which is the last setting the switch was at. So if the brightness had been set to 50% and then you turned the switch off then subsequently turned it back on by sending “255” it would turn the light on to the last brightness setting of 50%.
I am not worried about this last state (“255”) if I could get the on/off/brightness co-ordinated.
Thanks in advance for any help or advice that might be coming my way.
Chuck