Adding X10 support

HeyU operates from the

pi@homeassistant

example pi@homeassistant: heyu on O4

I know for homeassistant I’m launching from sudo systemctl start homeassistant so I believe they don’t operate in the same environment. How I get that to happen?

You need to find out what user homeassistant is running as.

Post the output of:
ps aux | grep home
And:
ls -alh /home
And:
ps aux | grep heyu

The solution ended up being when you install Heyu, there’s 4 options on where to put the config file. One limits HeyU specifically to the pi user, but option 3 lets all users view the config file. Once I did that, the whole thing started working.

Heyu is working. - modules are turning on / off as expected – however I am getting lots of the following errors in the error log. I have several of the older modules that may not be responding back …
<
2017-11-19 21:02:36 ERROR (MainThread) [homeassistant.helpers.entity] Update for light.front_lights fails
Traceback (most recent call last):
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/helpers/entity.py”, line 199, in async_update_ha_state
yield from self.async_device_update()
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/helpers/entity.py”, line 306, in async_device_update
yield from self.hass.async_add_job(self.update)
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/light/x10.py”, line 96, in update
self._state = bool(get_unit_status(self._id))
File “/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/light/x10.py”, line 38, in get_unit_status
output = check_output('heyu onstate ’ + code, shell=True)
File “/usr/lib/python3.5/subprocess.py”, line 316, in check_output
**kwargs).stdout
File “/usr/lib/python3.5/subprocess.py”, line 398, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘heyu onstate H1’ returned non-zero exit status 1
/>

Do you have Heyu running in/under HASS.IO or with Hassbian?

Bumping.

I have 50+ X10 devices. Light switches, Wall Plugs, Motion sensors, Remotes, Appliance Modules, and Lamp Modules. I am running Hassio, and would like to incorporate X10 into it.
Is there anyone that has X10 working with their Hassio???

Seek, and ye shall find: http://bfy.tw/GP11
Then tell us what you’ve tried, what didn’t work, error messages, log files etc.
We can go forward from there.

Short answer for me is no. I hit a couple of issues so moved to Hassbian.

Issues I hit:

  1. Raspberry Py 1 watchdog timer killers HA - I took a short cut and tried using a Pi3 without attempting to address watch dog issue and hit a different problem
  2. I could not get my serial device to show up - I use a USB to serial adapter and it wasn’t auto recognized when plugged in. I suspect this isn’t that difficult to resolve but it was less effort for me to set Hassbian up. I’m now using Hassbian with https://github.com/clach04/home-assistant-x10 - I finally have voice control over X10 :slight_smile:

I’m doing essentially the same thing with DS10A door/window switches. I have a rather noobie HA question for you: how do you define the binary_sensor.b2 & b3 entities? Do they automagically appear when you send something to the API, or are they predeclared?

x10.com has announced a WiFi hub - WM100. I don’t see any API specs but probably shouldn’t be too hard to hack and or expand in the future.

https://www.x10.com/wm100.html

I did the same as you. Works like a charm. I got Alexa activating my X10 devices. Hassbian is the way to go. Follow the instructions here Link and make sure you selection option 3 not option 1. Set up your config.yaml file and you’re good to go.

I’m now using Amazon Alex devices around the house and its really nice being able to dim lights with voice control :smile: The HA Hue bridge emulator is great!

Thank you so much for this!

I’m upgrading from MisterHouse and the one big piece I was missing was all my motion sensors.
heyu and your code snippet saved the day!

Whoa. I hope you like HASS.

It is just a tiny change. :slight_smile:
I’m working on it slowly, using node:red. Bit of a learning curve but pretty cool.
Had a bit of a stumble with Z wave but I think I’ve sorted that out and moving forward.

For those looking for a potential solution, the insteon_plm component now has X10 support. You need an Insteon PLM which costs about $80 USD.

good morning,
I return to this topic.
I have gotten all my disposable x10 more than 50 scattered around a house. everything an achievement.

but I have found that I am not able to make the blinds (covers), detect them as such.

I set them up as light, and I can give it up to shine and they work for me-

but if they are not covers, Homekit does not detect them as blinds and the pot goes away.

someone has managed to integrate as cover the blinds with X10

I have a box of X10 stuff i’d be willing to sell. I tested most of it about a year ago but decided to invest in zwave so it went back into a box.

Congrats on getting your x10 devices up and running with HA!

Do you have a link for this or are you asking if anyone has done this?

It would be relatively straight forward to write a cover that wraps the logic for switch (switch would make more sense than a light).

I actually have a pet project to write a lock wrapper on top of a cover (for a lock controlled via GPIO). I was going to hand write it specifically for the task, but I’m wondering if a generic approach for this is possible, e.g. wrap X as Y.

hello

So far I have managed to start a Cover,

with this code;

  • platform: template
    covers:
    windows_cover:
    friendly_name: “Persiana Despacho”
    position_template: “{{ (((10 | int) * 100)/18 | int) }}”
    tilt_template: “0”
    open_cover:
    service: light.turn_on
    data:
    entity_id: light.persiana_despacho
    close_cover:
    service: light.turn_off
    data:
    entity_id: light.persiana_despacho
    stop_cover:
    service: light.turn_on
    data:
    entity_id: light.persiana_despacho

but how much do I put another one,

it goes into a loop and I do not know how to solve it.

I would like to know how to set times for each one, since the X10 do not have a sensor to know if it is up or down, it only has X seconds.

Could someone help me?