I recently purchased a couple of Jinvoo branded Zigbee smart plugs and noticed that they have an entity called countdown. In an automation I can write a number value that equates to seconds into this field and the plug will countdown to zero and then turn off. The plug must first be turned on and then the value written for it to work.
This is quite a useful feature as I can replace some plugs that are running the same functionality but require software timers in HA to do this. To be more useful it would help if this number could be a dynamic entry from the dashboard as opposed to hard coded in the automation.
So I a number helper to see if I could pass this in to the plug’s countdown field but it doesn’t work. In an automation HA will let me selection the plugs countdown field to enter a value and it will let me select the helper as the variable for the target value, but it will not pass the number from the helper to the plug countdown parameter.
Is there a different method I should be using to write the figure held in the helper to the plugs countdown entity?
Agree, post your YAML formatted using the </> button in this editor.
A wild guess is that you need to cast it to an int or float to use it maybe, depending on where it is. | int(0) or | float(0) where ‘0’ is the default value you want there if things go wrong.
Call those 2 actions separately from dev tools > actions tab.
If they both work, you just need to set a small delay between the actions in your automation.
Most likely the countdown command is reaching the device before it’s done turning on.
You might have it backwards - I expect you need to set the number before you turn on the light - that’s how some of my similar plugs work. The light then comes on and sees that it needs to turn off in 30 minutes. - it starts the timer.
Mine are actually set and forget - so once set to 30 minutes, they never need to be changed - each time you turn them on they always turn off after 30 minutes
That was it, for some reason when you just set a raw number it works but when you introduce the extra code to resolve the helper integer there needs to be a delay betwen plug turn on and write countdown value.