I have a dimmer (Jung 1731DD) which is mainly operated manually, but I would like to switch this dimmer on in case I’m not at home. This dimmer can be switched on/off using a pulse signal (relay on for 100ms). To make this work I have a Shelly 2.5.:
One port is used as pulse relay (shelly is configured to automatically switch off after 0.1s).
the other port of the shelly (always on) to feed the dimmer and measure the power consumption of the dimmer
When the light entity is toggled via the lovelace interface it switches on and because the shelly switches of after 0,1s the light entity it is automatically also switched off again.
Another problem is that when providing a pulse one does not know whether the pulse toggled the dimmer to on or off.
Now I would like to make an entity that sends payload: “on” to toggle the dimmer and use the power consumption reading to determine whether the dimmer is on or off. How can I do that?
Though the time setting is colored red it does work properly. The other switch port (relay/0) is configured to be always switched on to ensure the dimmer has power and the power consumption of the dimmer is measured.
In configuration.yaml
mqtt:
light:
- schema: template
name: "Eetkamer"
unique_id: "Verlichting_eetkamertafel"
command_topic: "shellies/shellyswitch25-eetkamer/relay/1/command"
command_on_template: "on"
command_off_template: "on"
qos: 2 #essential to ensure that the message is only send once. qos: 1 might lead to multiple triggers sent to the shelly sometimes leading that toggle is not effective
# optimistic: true # On itself usefull as it will instantly toggle the status and waits for the state_template to confirm, but when activated the toggle is replaced by 2 icons indicating status on and off
state_topic: "shellies/shellyswitch25-eetkamer/relay/0/power"
state_template: "{{ iif(value|int >= 3, 'on', 'off') }}" # When the shelly reads a power consumption of more than 3Watt it is considered on
Not essential and only for monitoring purposes I’ve also added 2 sensors that report the power (W) and energy (kWh) consumption. Therefore you have to add the configuration below to the configuration above.
sensor:
- name: "Vermogen lamp eetkamer"
unique_id: "vermogen_lamp_eetkamer"
qos: 1
expire_after: 86400
state_class: measurement
device_class: power
unit_of_measurement: 'W'
state_topic: "shellies/shellyswitch25-eetkamer/relay/0/power"
- name: "Energieverbruik lamp eetkamer"
unique_id: "Energieverbruik_lamp_eetkamer"
qos: 1
expire_after: 86400
state_class: total_increasing
device_class: energy
unit_of_measurement: 'kWh'
state_topic: "shellies/shellyswitch25-eetkamer/relay/0/energy"
value_template: "{{ (value|float/60/1000)|round(2) }}" #shelly report energy consumption in Wminute an therefore needs to be divided by 60 and 1000 to convert into kWh
@Vliegeraar
Were you ever able to also control the dimming functionality in your scenario?
I have the same scenario but with a Niko 33-700 dimmer at the switch board and Niko pulse switches in the room.
I currently have it working (in an ugly test setup at the switch board) to turn it on & off with a shelly plus 1 mini PM but I can not get it to dim via the shelly.
Dimming with the switch still works.
To be honest I’m not sure if I got the right device or not but ideally i want to get a shelly behind the switch to just replicate the pulses that the switch is sending and integrate it in HA. I have a shelly dimmer 2 here as well but as the dimmer in the switch board needs to do the actual dimming this also does not seem like the right solution to me.
The switch currently only has a live wire and the switch wire (no neutral wire).
Would appreciate any input you have as I find very little information on this kind of setup around the web.
I only use this setup to toggle the dumb dimmer on/off. The reason the pulse is only 0.1s is because if it will take longer, the dimmer will start cycling through higher and lower light intensity. But I have no clue where the dimmer is in its cycle and consequentially, I can’t set the the dimmer to a desired intensity.