Raspberry Pi & 433MHz

1,438 views
Skip to first unread message

Nolan

unread,
Jan 28, 2015, 2:37:59 PM1/28/15
to home-assi...@googlegroups.com
Hi,

I'd like to install Home Assistant on a Raspberry Pi and use it to control a 433MHz transmitter for cheap RF outlets.  I have the 433 RF outlets working on the Pi, and they are controlled from a command line program that sends specific on/off codes to the outlets.  i.e.

Turn On:
/home/pi/codesend 12345

Turn Off:
/home/pi/codesend 54321

I'm new to Python and wondering how difficult it would be to implement this platform.  Could someone help point me in the right direction?

You can read more about this specific RF outlet configuration at http://timleland.com/wireless-power-outlets/

Thanks

Stefan Krastanov

unread,
Jan 28, 2015, 2:40:11 PM1/28/15
to home-assi...@googlegroups.com
This might help: https://docs.python.org/3.4/library/os.html#os.system

You will still have to write the component. Check the examples.
> --
> You received this message because you are subscribed to the Google Groups
> "Home Assistant Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to home-assistant-...@googlegroups.com.
> To post to this group, send email to home-assi...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/home-assistant-dev/00465878-6d3a-4b81-9b9d-37f7d42b8f20%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Nolan

unread,
Jan 28, 2015, 2:53:08 PM1/28/15
to home-assi...@googlegroups.com, stefan.k...@yale.edu
Thanks.  Do I need to write a new component, or can I just write a new platform for the switch component?

Stefan Krastanov

unread,
Jan 28, 2015, 3:03:10 PM1/28/15
to home-assi...@googlegroups.com
Writing a new platform for the switch component is exactly what I did.
While not the best style, just copy-pasting another platform and
changing the definition of a few function should be sufficient.

On 28 January 2015 at 14:53, Nolan <nkgi...@gmail.com> wrote:
> Thanks. Do I need to write a new component, or can I just write a new
> platform for the switch component?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Home Assistant Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to home-assistant-...@googlegroups.com.
> To post to this group, send email to home-assi...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/home-assistant-dev/37ce7feb-8502-4984-8705-1ea5653589c8%40googlegroups.com.

Nolan

unread,
Jan 28, 2015, 3:44:29 PM1/28/15
to home-assi...@googlegroups.com, stefan.k...@yale.edu
Would you mind sharing your platform logic since you have already completed a similar task?  It would be much appreciated.  I'm a little lost looking at the switch/wemo.py

Stefan Krastanov

unread,
Jan 28, 2015, 4:14:26 PM1/28/15
to home-assi...@googlegroups.com
What I have does not work with the current version and I will not have
time to fix it until late next week. I will post some examples when I
have it.
> --
> You received this message because you are subscribed to the Google Groups
> "Home Assistant Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to home-assistant-...@googlegroups.com.
> To post to this group, send email to home-assi...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/home-assistant-dev/bb1b749a-16cb-4098-a444-0f1fe9e2c46c%40googlegroups.com.

Nolan

unread,
Jan 28, 2015, 4:15:46 PM1/28/15
to home-assi...@googlegroups.com, stefan.k...@yale.edu
That would be great, thanks!


On Wednesday, January 28, 2015 at 4:14:26 PM UTC-5, Stefan Krastanov wrote:
What I have does not work with the current version and I will not have
time to fix it until late next week. I will post some examples when I
have it.

On 28 January 2015 at 15:44, Nolan <nkgi...@gmail.com> wrote:
> Would you mind sharing your platform logic since you have already completed
> a similar task?  It would be much appreciated.  I'm a little lost looking at
> the switch/wemo.py
>
> On Wednesday, January 28, 2015 at 3:03:10 PM UTC-5, Stefan Krastanov wrote:
>>
>> Writing a new platform for the switch component is exactly what I did.
>> While not the best style, just copy-pasting another platform and
>> changing the definition of a few function should be sufficient.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Home Assistant Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an

Paulus Schoutsen

unread,
Jan 29, 2015, 11:36:44 AM1/29/15
to home-assi...@googlegroups.com
Best switch platform to work off would be the Tellstick one. Copy and paste it to config/custom_components/switch/your_platform.py 

Change it to have get_devices return a list with your switch, overwrite the turn_on/turn_off commands with calling your command line functions.

Only tricky part is that you have no way of checking if your switch is on/off. You can just have is_on return True if turn_on was called last, False if turn_off was called last.

Good luck!

To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-...@googlegroups.com.

To post to this group, send email to home-assi...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
It's nice to be important but it's more important to be nice.

Nolan

unread,
Jan 30, 2015, 2:14:41 PM1/30/15
to home-assi...@googlegroups.com
Thank you so much for your help!  I was able to get everything working great!


On Thursday, January 29, 2015 at 11:36:44 AM UTC-5, Paulus Schoutsen wrote:
Best switch platform to work off would be the Tellstick one. Copy and paste it to config/custom_components/switch/your_platform.py 

Change it to have get_devices return a list with your switch, overwrite the turn_on/turn_off commands with calling your command line functions.

Only tricky part is that you have no way of checking if your switch is on/off. You can just have is_on return True if turn_on was called last, False if turn_off was called last.

Good luck!
On Wed, Jan 28, 2015 at 1:15 PM, Nolan <nkgi...@gmail.com> wrote:
That would be great, thanks!

On Wednesday, January 28, 2015 at 4:14:26 PM UTC-5, Stefan Krastanov wrote:
What I have does not work with the current version and I will not have
time to fix it until late next week. I will post some examples when I
have it.

On 28 January 2015 at 15:44, Nolan <nkgi...@gmail.com> wrote:
> Would you mind sharing your platform logic since you have already completed
> a similar task?  It would be much appreciated.  I'm a little lost looking at
> the switch/wemo.py
>
> On Wednesday, January 28, 2015 at 3:03:10 PM UTC-5, Stefan Krastanov wrote:
>>
>> Writing a new platform for the switch component is exactly what I did.
>> While not the best style, just copy-pasting another platform and
>> changing the definition of a few function should be sufficient.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Home Assistant Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> To post to this group, send email to home-assi...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/home-assistant-dev/bb1b749a-16cb-4098-a444-0f1fe9e2c46c%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Home Assistant Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-dev+unsub...@googlegroups.com.
To post to this group, send email to home-assi...@googlegroups.com.

Nolan

unread,
Jan 30, 2015, 5:22:56 PM1/30/15
to home-assi...@googlegroups.com
Next step is to figure out how to create my custom platform for the light component since the switch component isn't supported in device_sun_light_trigger.

Paulus Schoutsen

unread,
Jan 30, 2015, 5:59:45 PM1/30/15
to home-assi...@googlegroups.com
You can always use the automation component to do some easy turn on/turn off commands.

To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-...@googlegroups.com.

To post to this group, send email to home-assi...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Nolan

unread,
Jan 30, 2015, 7:36:19 PM1/30/15
to home-assi...@googlegroups.com
I have been able to accomplish most of my desired tasks with the automation component.  Is it possible to have a trigger that watches 2 different device_trackers?  Hoping to turn off the lights when both people leave the house.

Thanks



--
It's nice to be important but it's more important to be nice.

--
You received this message because you are subscribed to the Google Groups "Home Assistant Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-dev+unsub...@googlegroups.com.
To post to this group, send email to home-assi...@googlegroups.com.

Paulus Schoutsen

unread,
Jan 30, 2015, 8:20:41 PM1/30/15
to home-assi...@googlegroups.com
That's where groups come in. See this example.

Paulus

To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-...@googlegroups.com.

To post to this group, send email to home-assi...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Nolan

unread,
Jan 30, 2015, 9:14:03 PM1/30/15
to home-assi...@googlegroups.com
Thanks!!! I love this project



--
It's nice to be important but it's more important to be nice.

--
You received this message because you are subscribed to the Google Groups "Home Assistant Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-dev+unsub...@googlegroups.com.
To post to this group, send email to home-assi...@googlegroups.com.
Message has been deleted

Stefan Janssen

unread,
Apr 29, 2015, 9:53:22 AM4/29/15
to home-assi...@googlegroups.com
Hi Paulus,

I'm kind of new to this project, and I really love the way it works.
The work you're been doing on the zwave support is great, but as I read not ready to control switches. 
So that's why I currently try to connect to existing zwave server from HA, which I can do by API with HTTP requests.
I checked this Google group, but I can't find a way to set up a HTTP request to access my zwave API. 

I start playing around and found out myself already that the 'tellstick one' is a good start indeed. 
But I'm not sure how to make this thing work. I tried an urllib.request.urlopen request, from my custom_components file, which works but only on initial load.
How can I connect this command properly to a working switch inside HA?

Hope you can point me in the right direction.
Thanks,

Stefan


Op donderdag 29 januari 2015 17:36:44 UTC+1 schreef Paulus Schoutsen:

Paulus Schoutsen

unread,
Apr 29, 2015, 4:29:39 PM4/29/15
to home-assi...@googlegroups.com
If I understand you correctly, you want Home Assistant to poll your Z-Wave server from time to time and create entities based on that result?

Before you go into trying to integrate your Z-Wave server API, check the internet to see if there is a package available for it that exposes your Z-Wave server in easy to use Python objects. If that is not the case you'll have to create something yourself. To fetch data, it is easiest to use python-requests which is already installed alongside with Home Assistant.

Instead of starting out with creating a component I would focus on creating a platform for the switch component. That way you can focus on integrating your Z-Wave device and not cary about keeping it all up to date.

Step 1: Create a new folder called switch inside your config/custom_components folder.

Step 2: Copy the file homeassistant/components/switch/demo.py to config/custom_components/switch/my_cool_switch.py

Step 3: Update your configuration.yaml file to load your switch:

switch:
  platform: my_cool_switch

Step 4: hack away!

--
You received this message because you are subscribed to the Google Groups "Home Assistant Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-...@googlegroups.com.
To post to this group, send email to home-assi...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Stefan Janssen

unread,
May 4, 2015, 10:15:28 AM5/4/15
to home-assi...@googlegroups.com
Hi Paulus,

It took me a couple days to figure it out, but I finally succeeded to get Home Assistant working with my Zwave server the way you described here.
I created a platform called 'Zwave' and loaded the demo.py as a template. 
With use of this Python library: import urllib.request and this command: 
urllib.request.urlopen("http://<myzwaveserver>/ZAutomation/api/v1/devices/%s/command/on").read() % deviceid 
I was able to get it working smoothly.

Now I can perform HTTP requests from Home Assistant. 
My next challenge is to find out how I can use this to get sensor information back into Home Assistant the same way, based on the Home Assistant polling events.
And find some nice icons for the GUI. :) This is getting more awesome now. I like to know if there is some more usefull stuff I can use in order to get more out of this polling, or Zwave. I have a complete Zwave enviroment, and a Raspberry Pi service running with a Zwave module, together with some additional analog sensors and radio and IR transmitter and receiver.

Thank you very much for this useful information. It was a great help.
Stefan




Op woensdag 29 april 2015 22:29:39 UTC+2 schreef Paulus Schoutsen:
To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-dev+unsub...@googlegroups.com.

To post to this group, send email to home-assi...@googlegroups.com.

Paulus Schoutsen

unread,
May 4, 2015, 10:43:29 AM5/4/15
to home-assi...@googlegroups.com

For sensors you can do the same steps but then copy the sensor/demo.py platform.

Icons are done automatically in the interface using the domain icon for switch, sensor etc. To overwrite you can set the state attribute entity_picture to a url.

Paulus


To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-...@googlegroups.com.
To post to this group, send email to home-assi...@googlegroups.com.



--
It's nice to be important but it's more important to be nice.

--
You received this message because you are subscribed to the Google Groups "Home Assistant Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-...@googlegroups.com.

To post to this group, send email to home-assi...@googlegroups.com.

Nolan

unread,
May 5, 2015, 12:38:09 PM5/5/15
to home-assi...@googlegroups.com
Is it possible for the interface to use a different domain icon, specifically an icon from a different component?  I'd like my custom switches to use the lightbulb icon, and my custom thermometers to use the thermometer icon.

Thanks,
Nolan
To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-dev+unsub...@googlegroups.com.
To post to this group, send email to home-assi...@googlegroups.com.



--
It's nice to be important but it's more important to be nice.

--
You received this message because you are subscribed to the Google Groups "Home Assistant Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-dev+unsub...@googlegroups.com.

Paulus Schoutsen

unread,
May 5, 2015, 12:44:04 PM5/5/15
to home-assi...@googlegroups.com
It's currently only possible to overwrite the whole badge with a picture by setting the entity_picture attribute.

Another approach would be to implement your custom switches and thermometers as platforms of these components, this should also get the icon right.

To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-...@googlegroups.com.
To post to this group, send email to home-assi...@googlegroups.com.



--
It's nice to be important but it's more important to be nice.

--
You received this message because you are subscribed to the Google Groups "Home Assistant Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-...@googlegroups.com.

To post to this group, send email to home-assi...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Home Assistant Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-...@googlegroups.com.

To post to this group, send email to home-assi...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Savale -

unread,
May 13, 2015, 2:27:14 AM5/13/15
to home-assi...@googlegroups.com
I just wrote a switch module to support "klik aan klik uit" (aka kaku) devices. It uses the kaku library instead of codesend.
But I will rewrite it in such a way that it can support every kind of 433mhz swiches. Let me know if one wants to test it.



Op woensdag 28 januari 2015 20:37:59 UTC+1 schreef Nolan:

pizadoros

unread,
Dec 19, 2015, 11:30:54 PM12/19/15
to Home Assistant Dev
hi there... i'm trying to control HomeEasy he107i ..wall light dimming switches. and i cant do it !  i've been trying for a couple of days now. i can receive the signal from the controller but cannot send it to the switch!  th home easy he107 switch is the same as the kaku switches. 

Joris

unread,
Mar 8, 2016, 7:00:27 AM3/8/16
to Home Assistant Dev
Hi Savale,

I'd be interested in testing the KAKU support. Currently looking into controlling the klikaanklikuit switches as well. I did locate an unfinished project here: https://raw.githubusercontent.com/karlTGA/home-assistant/f4b503935c395f7464d5d7bdbbe44cd62e2d08a6/homeassistant/components/switch/pilight.py where original creator seemed to have abandoned development. 

Can you share what you already developed?

Best regards
Joris

Op woensdag 13 mei 2015 08:27:14 UTC+2 schreef Savale -:

pizadoros

unread,
Mar 9, 2016, 7:04:13 AM3/9/16
to Home Assistant Dev
Hi nolan. Anybody still here? Can somebody PLEASE send me instructions on how to do what nolan did with code send through rcswitch??

I need the instructions for the home assistant setup. I know how to setup rcswitch.
I BEG YAA :)

Reply all
Reply to author
Forward
0 new messages