jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
191 stars 46 forks source link

Entity for controlling valve was not created #170

Open tj335 opened 2 years ago

tj335 commented 2 years ago

The only entities that were created in Home Assistant for this device was for the temperature and the water sensor. There’s no entity for controlling the valve. Here are the device details:

{
    "id": "1389",
    "name": "Zooz ZAC36 Ball Valve Controller",
    "label": "Main Water Shutoff",
    "type": "Zooz ZAC36 Ball Valve Controller",
    "attributes": [
        {
            "name": "temperature",
            "currentValue": 72.9,
            "dataType": "NUMBER"
        },
        {
            "name": "water",
            "currentValue": "dry",
            "dataType": "ENUM",
            "values": [
                "wet",
                "dry"
            ]
        },
        {
            "name": "valve",
            "currentValue": "open",
            "dataType": "ENUM",
            "values": [
                "open",
                "closed"
            ]
        }
    ],
    "capabilities": [
        "WaterSensor",
        {
            "attributes": [
                {
                    "name": "water",
                    "dataType": null
                }
            ]
        },
        "Configuration",
        "Refresh",
        "Valve",
        {
            "attributes": [
                {
                    "name": "valve",
                    "dataType": null
                }
            ]
        },
        "TemperatureMeasurement",
        {
            "attributes": [
                {
                    "name": "temperature",
                    "dataType": null
                }
            ]
        }
    ],
    "commands": [
        "close",
        "configure",
        "open",
        "refresh"
    ]
}
jason0x43 commented 2 years ago

The integration doesn't yet handle water valves.

From the docs it looks like a valve just supports open and close commands. Home Assistant doesn't have a "water valve" device type (that I'm aware of), but it could be modeled as a simple switch, or maybe a light control if it can be partially opened or closed.

jason0x43 commented 2 years ago

You should be able to test it using the send_command Hubitat service.

  1. Open the Services tab in Developer Tools in Hubitat.
  2. Choose the "Hubitat: send_command" service
  3. For the entity, just choose any one of the entities that were created for the valve device
  4. For the command, put "open"
  5. Click call service
tj335 commented 2 years ago

Thanks for getting back to me. I thought the valve was implemented after I searched on the community site thread, sorry for the confusion. As a workaround I created a virtual switch in Hubitat and exposed that to HA. Then I have a rule in Hubitat to control the valve based on the virtual switch. Calling the service as you described worked.