I am new to HA and my goal is to reverse the reported state of my FortrezZ (WV-01) Water Valve within HA which shows up as a switch (in HA).
The WV-01 Valve is joined to my Vera Hub
I have the latest Vera Integration installed in HA.
The valve is recognized in HA as a switch as entityID “switch.house_main_314”.
HA will open and close the valve by toggling the switch toggle in HA, however the state shows as reversed.
Meaning when the valve is CLOSED HA shows the icon and switch toggle as ON, and when the valve is OPEN the icon and switch toggle show as OFF.
I would like is so when the valve is OPEN HA shows as ON, and when CLOSED HA shows as OFF.
Any pointers or examples of would be greatly appreciated.
HA is installed on a QNAP NAS Docker instance:
—-------------------------------------------
Version core-2022.4.7
Installation Type Home Assistant Container
Development false
Supervisor false
Docker true
User root
Virtual Environment false
Python Version 3.9.9
Operating System Family Linux
Operating System Version 5.10.60-qnap
CPU Architecture x86_64
Timezone America/New_York
---------------------————————————
The template that I used to get my FortrezZ WV-01 showing as a Valve vs a Switch and reversing the state that was incorrectly being reported by HA is as follows:
I placed the below into the configuration.yaml. The HA entity ID for the valve in question is “switch.irrigation_main_314”
Note that this creates a new additional switch named ‘irrvalve’ in HA with a friendly name of “Irrigation Valve tpl”, meaning the actual entity is still present in HA but you will need to either hide it or not use it in your dashboard cards (I chose the latter) and use the new one that this template creates. I know this would be obvious to most, but it wasn’t for me thinking like an HA newbie.
For QNAP container station HA Docker users. Restarting HA from within the HA GUI doesn’t reload the configuration.yaml. Go into container station and restart the HA container there, I know that’s a bit hard core, but that’s what I found that works vs Configuration->Settings->Server Control->Restart Home Assistant in the HA GUI.
This is the code I use. In my case I use a Tuya valve turner to operate some DC isolators for a solar system where the isolators are in an inconvenient position behind a rain water tank.
Due to the location and rotation direction of the isolators, the switches end up showing the status reversed (ie off = isolators connected), here’s my solution.
Using this, you can change the wording on the card that is reported per state, the colours and the icons as well as the text positions etc.
It’s doesn’t modify the switch state anywhere except for display on the card, the card is actionable and set to toggle in my case.
You will need custom:button-card installed for this to work.