Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Valves unable to be controlled. #275

Closed
AJolly opened this issue May 26, 2024 · 8 comments
Closed

Valves unable to be controlled. #275

AJolly opened this issue May 26, 2024 · 8 comments

Comments

@AJolly
Copy link

AJolly commented May 26, 2024

Valves just show up asbinary sensors and don't allow for control.

Full hubitat device info:

{
	"name": "Zooz ZAC36 Ball Valve Controller",
	"label": "ZoozValve",
	"type": "Zooz ZAC36 Ball Valve Controller",
	"id": "376",
	"date": "2024-05-26T03:41:39+0000",
	"model": null,
	"manufacturer": null,
	"room": "Guest BR",
	"capabilities": [
		"WaterSensor",
		"Configuration",
		"Refresh",
		"Valve",
		"TemperatureMeasurement"
	],
	"attributes": {
		"valve": "open",
		"dataType": "ENUM",
		"values": ["wet", "dry"],
		"temperature": "72.9",
		"water": "dry"
	},
	"commands": [
		{ "command": "close" },
		{ "command": "configure" },
		{ "command": "open" },
		{ "command": "refresh" }
	]
}

image

@jason0x43
Copy link
Owner

I added preliminary support in v0.9.29-pre0. Give that a try and let me know if it works.

@d1g1talweb
Copy link

d1g1talweb commented Jul 8, 2024

I have a Saswell valve that uses the Tuya Zigbee Valve device driver. I now see the Valve entity created in HA but then it says "This entity is no longer being provided by the hubitat integration. If the entity is no longer in use, delete it in settings." and the Entity shows as unavailable.
Here is the full device info from HE and a screenshot of what i see in HA. Also, i'm on version v0.9.29 of the Hubitat Integration.

{
  "id": "1596",
  "name": "Tuya Zigbee Valve",
  "label": "Sprinkler",
  "type": "Tuya Zigbee Valve",
  "room": "Outside",
  "attributes": [
    {
      "name": "irrigationEndTime",
      "currentValue": null,
      "dataType": "STRING"
    },
    {
      "name": "rtt",
      "currentValue": -1625505821,
      "dataType": "NUMBER"
    },
    {
      "name": "weatherDelay",
      "currentValue": null,
      "dataType": "ENUM",
      "values": [
        "disabled",
        "24h",
        "48h",
        "72h"
      ]
    },
    {
      "name": "waterConsumed",
      "currentValue": null,
      "dataType": "NUMBER"
    },
    {
      "name": "irrigationCapacity",
      "currentValue": null,
      "dataType": "NUMBER"
    },
    {
      "name": "irrigationStartTime",
      "currentValue": null,
      "dataType": "STRING"
    },
    {
      "name": "valve",
      "currentValue": "closed",
      "dataType": "ENUM",
      "values": [
        "open",
        "closed"
      ]
    },
    {
      "name": "checkInterval",
      "currentValue": null,
      "dataType": "NUMBER"
    },
    {
      "name": "healthStatus",
      "currentValue": "online",
      "dataType": "ENUM",
      "values": [
        "offline",
        "online"
      ]
    },
    {
      "name": "irrigationDuration",
      "currentValue": 1800,
      "dataType": "NUMBER"
    },
    {
      "name": "battery",
      "currentValue": 75,
      "dataType": "NUMBER"
    },
    {
      "name": "timerState",
      "currentValue": "enabled (off)",
      "dataType": "ENUM",
      "values": [
        "disabled",
        "active (on)",
        "enabled (off)"
      ]
    },
    {
      "name": "powerSource",
      "currentValue": "[]",
      "dataType": "ENUM",
      "values": [
        "battery",
        "dc",
        "mains",
        "unknown"
      ]
    },
    {
      "name": "timerTimeLeft",
      "currentValue": 60,
      "dataType": "NUMBER"
    },
    {
      "name": "lastIrrigationDuration",
      "currentValue": null,
      "dataType": "STRING"
    },
    {
      "name": "lastValveOpenDuration",
      "currentValue": 0,
      "dataType": "NUMBER"
    }
  ],
  "capabilities": [
    "Configuration",
    "Actuator",
    "PowerSource",
    {
      "attributes": [
        {
          "name": "powerSource",
          "dataType": null
        }
      ]
    },
    "Refresh",
    "Battery",
    {
      "attributes": [
        {
          "name": "battery",
          "dataType": null
        }
      ]
    },
    "Valve",
    {
      "attributes": [
        {
          "name": "valve",
          "dataType": null
        }
      ]
    },
    "HealthCheck",
    {
      "attributes": [
        {
          "name": "checkInterval",
          "dataType": null
        }
      ]
    }
  ],
  "commands": [
    "close",
    "configure",
    "open",
    "ping",
    "refresh",
    "setIrrigationCapacity",
    "setIrrigationMode",
    "setIrrigationTimer"
  ]
}
image image

@AJolly
Copy link
Author

AJolly commented Jul 10, 2024

Is v0.9.29 and pre0 the same?

Screenshot_2024-07-10-10-24-02-16_c3a231c25ed346e59462e84656a70e50

The valves control shows up, but is unable to be controlled.

I've got it working by just using a rest_command manually configured in ha config.

"http://192.168.40.3/apps/api/3/devices/376/close?access_token=

@jason0x43
Copy link
Owner

Some logging info would be helpful, but in the meantime I pushed v0.9.30 with some valve improvements. Give that a try and let me know if it works.

@d1g1talweb
Copy link

Some logging info would be helpful, but in the meantime I pushed v0.9.30 with some valve improvements. Give that a try and let me know if it works.

Here's what i get after enabling debug and reloading the HE Integration:

Logger: homeassistant.components.valve
Source: helpers/entity_platform.py:600
integration: Valve (documentation, issues)
First occurred: July 12, 2024 at 10:18:39 PM (3 occurrences)
Last logged: 2:59:36 PM

Error adding entity valve.sprinkler for domain valve with platform hubitat
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 600, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 914, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1355, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1000, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1126, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1061, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1006, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/valve/__init__.py", line 172, in state
    reports_position = self.reports_position
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/valve/__init__.py", line 149, in reports_position
    raise ValueError(f"'reports_position' not set for {self.entity_id}.")
ValueError: 'reports_position' not set for valve.sprinkler.
This error originated from a custom integration.

Logger: custom_components.hubitat.hub
Source: custom_components/hubitat/hub.py:484
integration: Hubitat (documentation, issues)
First occurred: July 12, 2024 at 10:19:06 PM (96 occurrences)
Last logged: 2:49:23 PM

Error handling event <Event device_id="1596" device_name="Sprinkler" attribute="rtt" value="-1217028967" unit="ms" description="Round-trip time is -1217028967 ms" type="None">: 'reports_position' not set for valve.sprinkler.
Error handling event <Event device_id="1596" device_name="Sprinkler" attribute="rtt" value="-1202462685" unit="ms" description="Round-trip time is -1202462685 ms" type="None">: 'reports_position' not set for valve.sprinkler.
Error handling event <Event device_id="1596" device_name="Sprinkler" attribute="rtt" value="-1201243503" unit="ms" description="Round-trip time is -1201243503 ms" type="None">: 'reports_position' not set for valve.sprinkler.
Error handling event <Event device_id="1596" device_name="Sprinkler" attribute="rtt" value="-1194157532" unit="ms" description="Round-trip time is -1194157532 ms" type="None">: 'reports_position' not set for valve.sprinkler.
Error handling event <Event device_id="1596" device_name="Sprinkler" attribute="battery" value="75" unit="%" description="None" type="physical">: 'reports_position' not set for valve.sprinkler.

@jason0x43
Copy link
Owner

Thanks! I think I see what's wrong.

Give v0.9.31 a try.

@d1g1talweb
Copy link

v0.9.31 seems to have fixed the issue, for me at least. The valve shows up as a device and the controls work now!

Thanks so much for this awesome integration!

@AJolly
Copy link
Author

AJolly commented Jul 14, 2024

Works for me!

@AJolly AJolly closed this as completed Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants