ISY994 Variables as Sensors

Would it help to give you the /rest/node definitions of mine?
I have a zwave thermostats, locks, plugins, an outlet, light switches, floodlight, outdoor modules all on my ISY.

Yes! Now that I have a decent understanding of the integration I’ll double-check & include what I can when I have time. You can upload them to a pastebin or GitHub Gist and send me a message with the link. Let me know if there is anything specific that you know isn’t working–I know one is the Multisensors.

EDIT: Actually I think I got what I need from Blueman2 and the ISY SDK. What I really need is someone to test the changes discussed in the link below. I can get halfway there by dumping @blueman2’s file into the ISY emulator, but Z-Wave doesn’t include state values until the event stream-- tl;dr: it has to be tested with real data I don’t have.

Updates for anyone using this code:

@shbatm,

I have been very successfully running your HACS ISY994 plug in. Thanks again for the great work on this. I was hoping you might help me diagnose an error message I get quite frequently. It happens when I query one of my z-wave devices using a REST command in order to ensure I have the most recent data (it is my home energy monitor). Here is the error I get:

2019-08-25 12:41:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/rest_command/__init__.py", line 103, in async_service_handler
    headers=headers,
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 497, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 844, in start
    message, payload = await self._protocol.read()  # type: ignore  # noqa
  File "/usr/local/lib/python3.7/site-packages/aiohttp/streams.py", line 588, in read
    await self._waiter
concurrent.futures._base.CancelledError

And here is the REST command I have set up in configuration.yaml:

rest_command:
  zw030_query:
    url: http://192.168.1.145/rest/query/ZW030_143
    username: xxxx
    password: xxxx
    timeout: 15

I added the timeout to see if that helps, but no joy. Any other thoughts? The command works fine to update my energy usage, but I one of those who hates seeing error messages in logs! :wink:

You’ve got me on that one… it looks like it might be something core to the REST component and async libraries in use: https://github.com/aio-libs/aiohttp/issues/2098

Hey @shbatm, I’m very interested in your work here! Any plans to to submit your work as a PR?

Yes*.

These variable changes are part of several improvements to the ISY integration in Hass but also rely on some significant updates to the underlying PyISY module. Those changes are being reviewed and tested first before I start to trickle in the updates to Hass.

I highly recommend trying the ISY994 HACS add-in to help test these changes now and root out any bugs. The HACS add-in adds a drop in replacement for the default isy994 integration as a custom_component, but includes all of the updates.

I just tried this out and found that it doesn’t seem to include decimal from my variable so my sensors reads 512 instead of 51.2.

I can make a template senors to correct this, but it would be nice if it showed it correctly in the first place.

Sounds like the precision isn’t being picked up the way it should be. I’ll take a look when I get a chance.

@Blueman2 - Do you (or anyone else using ISY variables in Home Assistant) use anything but the sensor platform?

I need to make a change to how these are configured to improve compatibility with the config flow.

The plan is to make variables behave similarly to the sensor_string and ignore options:

  • The config will have an option for Sensor Variables String: "ha." Any variable names containing this string will be added to Home Assistant as as sensor.
  • switch and binary_sensor will be removed, since those can be modeled using Programs already.
  • Device class, icons and unit of measurement will be set in the device customization within Home Assistant, rather than the config.yaml.

Any objections to this?

I do make use of binary_sensor in my setup for 6 variables, but let me look at why.

OK. The new v1.4 versions will have gotten rid of the binary_sensors. You’ll have to update your config to keep using regular sensors.

For the binary sensors: I would recommend setting them up as programs with the status returning true or false (see this page for the details).

I’m sorry, I hate removing functionality, but I’m in a big push right now to make this compatible with the core code and the way I set up the variables before is not going to pass muster when it gets to review.

Also, just FYI - the new v1.4.x versions also have services to set variables from Home Assistant, so you’ll be able to update whatever variables you need to from within HA with the isy994.set_variable service.

WHAT? :slight_smile: ) So I can change the value of a variable when that comes out? Very cool! I have been creating custom scripts to send REST commands to set variables.

WRT to the binary_sensor, no worries. I can easily work around that. I am very excited to see your work get put back into the core ISY function. That should make overall support going forward much cleaner. Well done, @shbatm!

Variables, Programs, and Network Resources can now be updated/run through Home Assistant services instead of separate REST commands.

1 Like

Should also mention, there is now an isy994.reload service which will let you pick up changes made on the ISY without restarting Home Assistant.

2 Likes

So how do I enable Beta sources in HACS? I tried the 3 dots in upper right, but no Beta option.

edit: nvrmnd found it

FYI:

hello, have been following along for a while and have been trying to troubleshoot on my own and still cannot get a working solution…

using the insteon plugin im able to find my hub and light dimmer,
isy999 variation gives me error
‘Bad ISY Request: http://192.168.2.186:25105/rest/config 404’

also, ive been dieing to get the thermostat to work, any suggestions?
worth noting, this model is not compatible with linc windows software

hub: insteon 2245-222 rev 3.3 - 0519
thermostat: insteon 2441th rev2

The isy994 version only works if you have an ISY994 controller from Universal Devices, Inc.; it does not support the Insteon Hubs.

I think you’re looking for the work that @teharris1 is doing here: