X10 Community Forum
💬General Category => Mac/Linux & Open Source and the X10 Home => Raspberry Pi, Arduino & other SBC => Topic started by: lviper on August 23, 2018, 02:06:10 PM
-
I just wanted to share a few pics of my HA setup that includes X10 stuff.
These pics show 2 pages of my frontend webpage. I have circled the lights on the one page that are x10. The second page are all my door and motion sensors which are all x10.
-
Home Assistant has a nice feature called HADashboard which is basically a way to control you HA from a tablet or phone. I finally got mine setup this week on a Fire 7 tablet. Now I just need to mount it on the wall.
Hadashboard is just a webpage and I use an app called Fully Kiosk to display it full screen.
-
A couple of cameras would fit in there nicely if you were that way inclined. As you can see it looks quite impressive and is very modular. Quite straightforward adding other technologies to your project as you go along too.
Great to see you got it all up and running.
Edit. Just saw your camera screens now. Definitely finishes it all off nicely.
-
I have done more with HA in the past few weeks then I have done in all the years I've been running automation stuff.
I started with AHP Pro and a CM15a. Moved on to another program called Home Control Assistant with a CM11a and W800USB. Add in the XTB-IIR and I had a flawless system. Just hated the fact I couldn't have my MS16a trigger my Sengled Zigbee smart bulb unless I used IFTTT.
In came HA a short while ago and everything is now working with each other and it's fast!
-
Looks like you've found a "keeper" with Home Assistant. How did you go about installing HADashboard.
-
Looks like you've found a "keeper" with Home Assistant. How did you go about installing HADashboard.
Yes, this is a keeper. HAdashboard I'll admit was a bear, but I slowly followed the instructions here.
https://appdaemon.readthedocs.io/en/latest/DASHBOARD_INSTALL.html (https://appdaemon.readthedocs.io/en/latest/DASHBOARD_INSTALL.html)
Once I had my test dashboard up and running I took off with what I have now.
I want to go back and split things up in to modules. That way I can include certain common things in other dashboards to different devices and resolutions as well as rooms.
I'm just lucky it's slow at work which has afforded me a lot of play time.
-
Looks like you've found a "keeper" with Home Assistant. How did you go about installing HADashboard.
Yes, this is a keeper. HAdashboard I'll admit was a bear, but I slowly followed the instructions here.
https://appdaemon.readthedocs.io/en/latest/DASHBOARD_INSTALL.html (https://appdaemon.readthedocs.io/en/latest/DASHBOARD_INSTALL.html)
Once I had my test dashboard up and running I took off with what I have now.
I want to go back and split things up in to modules. That way I can include certain common things in other dashboards to different devices and resolutions as well as rooms.
I'm just lucky it's slow at work which has afforded me a lot of play time.
Home automation is a labour of love and requires patience. Try fail, read up, ask questions and try again.
Clearly you stuck with it and im impressed at your results. Once you find a platform you're comfortable working in it's worth sticking with it. Patience is king. There's no quick fix here but the results were definitely worth it.
Unlike yourself I'm back in the thick of it work wise so I'll revisit HADashboard. Might be worth while doing a write up on how you succeeded with HADashboard install. I'll be watching out for your progress. :)%
-
Nice to see your screen shots it does help one see the possibilities of HA.
HA does need some work on its front end to attract newbie users. The initial install provides no inspiration however post like this do! #:)
-
Just curious to know what method you used when installing Home Assistant. Was it Docker, Python Virtual Environment or Hass.io. I was looking at the Pip installation and if that's what you used you definitely conquered Everest. Doesn't look too easy. You may want to share that experience while it's still fresh in your mind when you get a chance. >*<
-
I install HA following the Raspbian install instructions on the home assistant site. I believe that's the virtualenv method. I do remember running pip commands. I'll make an attempt at writing down my steps as best as I remember them.
-
I install HA following the Raspbian install instructions on the home assistant site. I believe that's the virtualenv method. I do remember running pip commands. I'll make an attempt at writing down my steps as best as I remember them.
How did you install AppDaemon when installing HADashboard. Doesn't look like its for the faint hearted but the results are very impressive. I believe HADashboard is not really suitable for use outside of the home. I'm looking forward to giving it a go.
-
How did you install AppDaemon when installing HADashboard. Doesn't look like its for the faint hearted but the results are very impressive. I believe HADashboard is not really suitable for use outside of the home. I'm looking forward to giving it a go.
I followed the instructions I linked to in my prior post.
https://appdaemon.readthedocs.io/en/latest/DASHBOARD_INSTALL.html (https://appdaemon.readthedocs.io/en/latest/DASHBOARD_INSTALL.html)
The very first step said refer to the AppDaemon install at
https://appdaemon.readthedocs.io/en/latest/INSTALL.html (https://appdaemon.readthedocs.io/en/latest/INSTALL.html)
Since I had installed HA using the manual HA install on a raspberry pi here which uses the virtual environment method
https://www.home-assistant.io/docs/installation/raspberry-pi/ (https://www.home-assistant.io/docs/installation/raspberry-pi/)
I installed AppDaemon using the pip method. I followed all the steps but I did skip the optional steps. Just wanted to see if I could get it running first. Then I could always revisit the optional steps I skipped. Basically I copied the sample config file entering my info and skipped down past the test app to the Running section for PIP3. I saw what they say I should see when starting it so I moved down to the instructions for starting at reboot. I then went back to setting up my first test dashboard.
I also added the disable_apps: directive since I wasn't worried about running apps right now and hadashboard didn't need it.
Here is my appdaemon.yaml file. I removed the secret stuff because I didn't use the secrets.yaml. I put my url and key directly in the file for simplicity. I may change that later.
pi@RPi3bplus-HA:/home/homeassistant/.homeassistant $ cat conf/appdaemon.yaml
appdaemon:
threads: 10
disable_apps: 1
plugins:
HASS:
type: hass
ha_url: https://redacted.duckdns.org:8123
ha_key: redacted
hadashboard:
dash_url: http://192.168.10.205:5050
access_file: /var/log/dash_access
-
How are you handling HA's inability to see x10 commands sent from other devices?
Mochad is capable of seeing PL & RF commands not just sending, something HA on the surface appears not to utilize.
-
How did you install AppDaemon when installing HADashboard. Doesn't look like its for the faint hearted but the results are very impressive. I believe HADashboard is not really suitable for use outside of the home. I'm looking forward to giving it a go.
I followed the instructions I linked to in my prior post.
https://appdaemon.readthedocs.io/en/latest/DASHBOARD_INSTALL.html (https://appdaemon.readthedocs.io/en/latest/DASHBOARD_INSTALL.html)
The very first step said refer to the AppDaemon install at
https://appdaemon.readthedocs.io/en/latest/INSTALL.html (https://appdaemon.readthedocs.io/en/latest/INSTALL.html)
Since I had installed HA using the manual HA install on a raspberry pi here which uses the virtual environment method
https://www.home-assistant.io/docs/installation/raspberry-pi/ (https://www.home-assistant.io/docs/installation/raspberry-pi/)
I installed AppDaemon using the pip method. I followed all the steps but I did skip the optional steps. Just wanted to see if I could get it running first. Then I could always revisit the optional steps I skipped. Basically I copied the sample config file entering my info and skipped down past the test app to the Running section for PIP3. I saw what they say I should see when starting it so I moved down to the instructions for starting at reboot. I then went back to setting up my first test dashboard.
I also added the disable_apps: directive since I wasn't worried about running apps right now and hadashboard didn't need it.
Here is my appdaemon.yaml file. I removed the secret stuff because I didn't use the secrets.yaml. I put my url and key directly in the file for simplicity. I may change that later.
pi@RPi3bplus-HA:/home/homeassistant/.homeassistant $ cat conf/appdaemon.yaml
appdaemon:
threads: 10
disable_apps: 1
plugins:
HASS:
type: hass
ha_url: https://redacted.duckdns.org:8123
ha_key: redacted
hadashboard:
dash_url: http://192.168.10.205:5050
access_file: /var/log/dash_access
Yes you can refine that AppDaemon.yaml file now that you have it up and running. Don't forget your security password setting and careful with SSL settings. Hope to have a go at an install over the weekend so fingers crossed :-*
-
How are you handling HA's inability to see x10 commands sent from other devices?
Mochad is capable of seeing PL & RF commands not just sending, something HA on the surface appears not to utilize.
I am very interested in this as well. I use MS16A motion sensors in HG to trigger scripts and turn on/off various lights. Without the ability to receive and act on X10 RF commands, I'm going to be stuck and HASS won't be a viable option. Also, I have several switches that send X10 PL commands that must be interpreted and utilized to turn on other lights (similar to the RF issue) and some that directly turn on/off lights (meaning HASS must update status). I see so much good in HASS but this basic issue will be critical for actually implementing it.
I don't know the answer, but from a quick search the following thread seems to indicate mochad_dispatch (mochad->MQTT) seems to be the only available solution. Seems kinda clunky though.
https://community.home-assistant.io/t/need-help-getting-x10-working/8180/22
-
How are you handling HA's inability to see x10 commands sent from other devices?
Mochad is capable of seeing PL & RF commands not just sending, something HA on the surface appears not to utilize.
I'm using a cm11a for plc. WGL Design's W800usb (supports both regular and security rf) for RF. And lastly HeyU.
Heyu has a state engine built in and the HA X10 component uses this for state information. When I use my palmpad to turn on a light, HA reflects this within a second or 2. HeyU also has a nice scripting function that allows me to map some palmpad rf signals to either be forwarded to plc or to the aux_engine to be processed by HA. So for example, my palmpad is house code F. F1 and F2 or forwarded to the aux_engine and never go to the powerline. This way I can use a script in heyu to send a command directly to HA to turn on a light on a different protocol. Meanwhile the rest of the unit codes on the palmpad transceive directly to plc.
That's why I say you could possibly use the rf of a cm15a to have mochad send everything to the powerline where the cm11 will pick it up and heyu act on it. Just wouldn't directly work for security rf though.
-
I can't believe HA uses Mochad but doesn't utilize all its possibilities! :o Makes me wonder how many other things in HA are half baked ::) :'
The mochad_dispatch >> MQTT user workaround is klunky to say the least. :(
However they're not the only Linux Home Automation software using mochad and not to its full potential ::) :'
-
I know there is way more potential for mochad, and if I knew how to program or script I would run with it. I bet someone who knew how could somehow merge heyu and mochad together so heyu would support the cm15a.
I just felt since I had invested so much in getting my X10 working so reliably with the W800usb for RF and the XTB-RII with CM11a for plc, I had to find a way to continue using the devices. I was never able to get reliable RF from the CM15a even with several different antenna mods. My house is a story and a half and if I include the unfinished full basement, I have over 4000 sq ft. I have my W800usb antenna on the main floor in the middle of the house and it just works. I have 6 MS16's around the house outside all triggering different lights and all of them report in all the time. I have 9 DS10a's on doors and windows and everyone reports in.
-
You've well and truly nailed X10 in Home Assistant along with the other aspects of home automation it has to offer. So much more to explore too by the looks of it. You've taken to Home Assistant on the Raspberry Pi like a duck to water >*<
So glad your experience was a positive one and a lot more to report in the coming months by the sounds of it.
-
I don't think heyu needs to be in the mix. (just more things running )
I wonder ::) HA has TCP and HTTP modules and since Mochad is a TCP based application one may be able to tap into that.
I'll see what I can learn on that front.
>!
-
Give this page a look. It's for the Restful API. I used this to have my old program, Home Control Assistant, make calls to turn on lights in HA before I setup X10 in HA.
https://developers.home-assistant.io/docs/en/external_api_rest.html (https://developers.home-assistant.io/docs/en/external_api_rest.html)
I also use MQTT Sensors to get my DS10a's and MS16's setup in HA.
https://www.home-assistant.io/components/sensor.mqtt/ (https://www.home-assistant.io/components/sensor.mqtt/)
-
I believe Rest , MTTQ and TCP would work but no better then how HA does it now with the Mochad module :(
There is a Broadlink switch module which will allow sending any x10 RF even security codes, However no way to tell if the switch was turned on/off by another device as the broadlink RM is oneway (send only). B:(
Saddly I see this isn't the software for me. :( Love your setup lviper!
>!
-
Just curious to know did you script and skin your own Dash files or did you mod examples that you found on the net. I finished off installing AppDaemon and HADashboard, did the Hello World thing so before I reinvent the wheel, did you find working examples you could mod yourself.
-
Just curious to know did you script and skin your own Dash files or did you mod examples that you found on the net. I finished off installing AppDaemon and HADashboard, did the Hello World thing so before I reinvent the wheel, did you find working examples you could mod yourself.
I did script my own dash file but used the default skin. I basically created my dash file from scratch using what I learned from examples on the net. Here is my main dash file for an example.
##
## Main arguments, all optional
##
title: Main Panel
widget_dimensions: [140, 140]
widget_size: [1, 1]
widget_margins: [5, 5]
columns: 7
global_parameters:
use_comma: 0
precision: 1
use_hass_icon: 1
namespace: default
devices:
media_player:
step: 5
layout:
- clock(2x1), sensor.smartthings_motionv4_0107d8a1_1_1026, alarm, spacer, spacer, cameradash
- weather(2x2), porchcamera(3x2), porchlight, weatherdash
- sidedoor
- barlight, polelight, craftlight, spotlights, patiolights, backdoor, familysecurity
clock:
widget_type: clock
show_seconds: 1
weather:
widget_type: weather
prefer_icons: 1
show_forecast: 1
forecast_title: Tomorrow
sensors:
icon: sensor.dark_sky_icon
temperature: sensor.dark_sky_temperature
apparent_temperature: sensor.dark_sky_apparent_temperature
humidity: sensor.dark_sky_humidity
precip_probability: sensor.dark_sky_precip_probability
precip_intensity: sensor.dark_sky_precip_intensity
precip_type: sensor.dark_sky_precip
pressure: "" #sensor.dark_sky_pressure
wind_speed: sensor.dark_sky_wind_speed
wind_bearing: sensor.dark_sky_wind_bearing
forecast_icon: sensor.dark_sky_icon_1
forecast_temperature_min: sensor.dark_sky_overnight_low_temperature_1
forecast_temperature_max: sensor.dark_sky_daytime_high_temperature_1
forecast_precip_probability: sensor.dark_sky_precip_probability_1
forecast_precip_type: sensor.dark_sky_precip_1
spotlights:
widget_type: light
icon_on: mdi-spotlight-beam
icon_off: mdi-spotlight-beam
entity: group.spotlights
title: Spot Lights
patiolights:
widget_type: light
icon_on: mdi-lightbulb
icon_off: mdi-lightbulb
entity: group.patiolights
title: Patio Lights
craftlight:
widget_type: light
icon_on: mdi-spotlight-beam
icon_off: mdi-spotlight-beam
entity: light.sengled_e11g13_0311c010_1
title: Craft Light
backdoor:
widget_type: light
icon_on: mdi-lightbulb
icon_off: mdi-lightbulb
entity: light.sengled_e11g13_03117c11_1
title: Back Door
alarm:
widget_type: alarm
entity: alarm_control_panel.alarm_system
title: Alarm Status
barlight:
widget_type: light
icon_on: mdi-lightbulb
icon_off: mdi-lightbulb
entity: light.bar
title: Bar Light
polelight:
widget_type: light
icon_on: mdi-lightbulb
icon_off: mdi-lightbulb
entity: light.pole
title: Pole Light
familysecurity:
widget_type: light
icon_on: mdi-lamp
icon_off: mdi-lamp
entity: light.family_room_security
title: Family Security Light
sidedoor:
widget_type: light
icon_on: mdi-lightbulb
icon_off: mdi-lightbulb
entity: light.side_door
title: Side Door
allfamilyroomlights:
widget_type: light
entity: group.familyroomlights
title: All Family Room Lights
cameradash:
widget_type: navigate
title: Cameras
dashboard: camera
icon_inactive: mdi-cctv
args:
timeout: 15
return: main
weatherdash:
widget_type: navigate
title: Weather
dashboard: weather
icon_inactive: mdi-weather-sunny
porchcamera:
widget_type: camera
entity_picture: https://REDACTED.duckdns.org:8123/api/camera_proxy_stream/camera.camera_proxy__camerafront_porch?&api_password=REDACTED
refresh: 300
porchlight:
widget_type: light
title: Porch Light
icon_on: mdi-lightbulb
icon_off: mdi-lightbulb
entity: light.porch
-
Probably the best route to go so.
The AppDaemon and HADashboard install instructions were overkill. The process was actually very straightforward in the end. Looking forward to designing my own HADashboard scripts and skins.
Plenty to keep busy over the winter months.
-
Well HADashboard is all up and running. iPad hung on the wall and visibility of widgets is 100%. Some very interesting HADashboard projects on GitHub that can be installed. All that's needed now is a little spare time to install them and configure them around my Home Assistant project.
-
Congrats. You're one step ahead of me. I still have to get my tablet mounted.
-
Congrats. You're one step ahead of me. I still have to get my tablet mounted.
It was one of the old Gen 1 iPads too. It was heading for the recyclers so I changed the battery and now it has a new home.
The options available to Home Assistant are endless. From basic configuration to high end automation. I'm glad I chose the Python install as the Docker and the Hass.io are very limiting expansion wise.
I'm still laughing at the four spaces and a dash problem one of the users came across in his dashboard configuration. He spent hours trying to figure out the problem. That's the problem when using a plain text editor. If you get down and deep with Python later on try PyCharm IDE. Open source and very able.
Anyway Home Assistant is the distraction of choice for the coming season. Should be fun to see what comes of it.
-
Could you post the config of your hadashboard3.dash file. I think I've discovered a bug in the way the configuration.yaml is passing names to the Dashboard but I just want to confirm this before I report it to Home Assistant.
-
Could you post the config of your hadashboard3.dash file. I think I've discovered a bug in the way the configuration.yaml is passing names to the Dashboard but I just want to confirm this before I report it to Home Assistant.
What I posted a few posts back is still my current main dash file.
-
Could you post the config of your hadashboard3.dash file. I think I've discovered a bug in the way the configuration.yaml is passing names to the Dashboard but I just want to confirm this before I report it to Home Assistant.
What I posted a few posts back is still my current main dash file.
Looking at that post you have 3 separate dashboard files, dashboard1.dash, dashboard2.dash and dashboard3.dash. I imagined you were calling them via navigate from a main page. The reason I ask is that I don't see your individual weather widgets configs.
-
Could you post the config of your hadashboard3.dash file. I think I've discovered a bug in the way the configuration.yaml is passing names to the Dashboard but I just want to confirm this before I report it to Home Assistant.
What I posted a few posts back is still my current main dash file.
Looking at that post you have 3 separate dashboard files, dashboard1.dash, dashboard2.dash and dashboard3.dash. I imagined you were calling them via navigate from a main page. The reason I ask is that I don't see your individual weather widgets configs.
Ahh, so sorry. Misunderstood what you were asking. Here is my weather.dash file. And yes, I call the camera and weather dash files with the navigate widget type. The camera dash is called with navigate using a timeout and return to main argument.
title: Weather Panel
widget_dimensions: [140, 140]
widget_size: [1, 1]
widget_margins: [5, 5]
columns: 7
layout:
- weather_frame(4x3),temperature, apparent_temperature, humidity
- precip_probability, precip_intensity, wind_speed
- summary, visibility, wind_bearing
- minutely_summary(2x1), hourly_summary(2x1), daily_summary(2x1), maindash
weather_frame:
widget_type: iframe
refresh: 300
frame_style: ""
img_list:
- https://icons.wxug.com/data/weather-maps/radar/united-states/bowling-green-kentucky-region-current-radar.gif
temperature:
widget_type: sensor
title: Current Temp
entity: sensor.dark_sky_temperature
apparent_temperature:
widget_type: sensor
title: Feels Like
entity: sensor.dark_sky_apparent_temperature
humidity:
widget_type: sensor
title: Humidity
entity: sensor.dark_sky_humidity
precip_probability:
widget_type: sensor
title: Precip Probability
entity: sensor.dark_sky_precip_probability
precip_intensity:
widget_type: sensor
title: Precip Intensity
entity: sensor.dark_sky_precip_intensity
wind_speed:
widget_type: sensor
title: Wind Speed
entity: sensor.dark_sky_wind_speed
summary:
widget_type: sensor
title: Current Condition
entity: sensor.dark_sky_summary
visibility:
widget_type: sensor
title: Visibility
entity: sensor.dark_sky_visibility
wind_bearing:
widget_type: sensor
title: Wind Direction
entity: sensor.dark_sky_wind_bearing
minutely_summary:
widget_type: sensor
title: Current Summary
entity: sensor.dark_sky_minutely_summary
hourly_summary:
widget_type: sensor
title: Hourly Summary
entity: sensor.dark_sky_hourly_summary
daily_summary:
widget_type: sensor
title: Daily Summary
entity: sensor.dark_sky_daily_summary
maindash:
widget_type: navigate
title: Main Dashboard
icon_inactive: fa-home
dashboard: main
-
Thanks.
It was a localization issue with HA which I reported and it's sorted now. I'm using a combination of sunset/sunrise and cloud cover for lighting automation which is now working properly
If you get a chance you should try Font Awesome and MDI icons. Takes the bare look off the dashboard. The Obsidian skin stands out well on the Dashboard too
-
.... I'm using a combination of sunset/sunrise and cloud cover for lighting automation which is now working properly
Care to share how you are doing this? I understand the sunrise/sunset using elevation, but I'm curious as to what you use for cloud cover. Which weather sensor are you using? I've tried Dark Sky but it isn't really all that accurate for my location. Either is YR or any of the non-US weather sensors. Yahoo is close but slow to update. Weather Underground is the most accurate and quickest to update but since they don't give out free api keys anymore, I'm afraid the key I already have may stop working at anytime. So I'm looking for an alternative which may have to be Yahoo weather.
If you get a chance you should try Font Awesome and MDI icons. Takes the bare look off the dashboard. The Obsidian skin stands out well on the Dashboard too
I've used some MDI Icons for my dashboard but many of the Font Awesome icons didn't work for some reason. I also haven't tried skinning yet but plan to some day.
-
These are the sensors I used based on Dark Sky Sensors in the configuration.yaml. The automation I configured in the Configuration section of the Home Assistant API using the States in the Developer Tools section
icon1:
title: Cloud
widget_type: sensor
entity: sensor.dark_sky_summary
units: "%"
precision: 0
icon2:
title: Rain
widget_type: sensor
entity: sensor.dark_sky_precip
state_text: 1
icon3:
title: Humidity
widget_type: sensor
entity: sensor.dark_sky_humidity
state_text: 1
icon4:
title: Wind Speed
widget_type: sensor
entity: sensor.dark_sky_wind_speed
state_text: 1
icon5:
title: Temperature
widget_type: sensor
entity: sensor.dark_sky_temperature
units: "°C"
precision: 0
icon6:
title: Wind Bearing
widget_type: sensor
entity: sensor.dark_sky_wind_bearing
state_text: 1
icon7:
title: UV Index
widget_type: sensor
entity: sensor.dark_sky_uv_index
state_text: 1
icon8:
title: Rain Total
widget_type: sensor
entity: sensor.dark_sky_precip_accumulation
state_text: 1
icon9:
title: UV Index
widget_type: sensor
entity: sensor.dark_sky_uv_index
state_text: 1
icon10:
title: Cloud Coverage
widget_type: sensor
entity: sensor.dark_sky_cloud_coverage
state_text: 1
icon11:
title: Daily Rain Intenisity
widget_type: sensor
entity: sensor.dark_sky_daily_max_precip_intensity
state_text: 1
icon123:
title: UV Index
widget_type: sensor
entity: sensor.dark_sky_daily_summary
state_text: 1
icon12:
title: Daytime High Appparent
widget_type: sensor
entity: sensor.dark_sky_daytime_high_apparent_temperature
state_text: 1
icon13:
title: Day Time High
widget_type: sensor
entity: sensor.dark_sky_daytime_high_temperature
state_text: 1
icon14:
title: Dew Point
widget_type: sensor
entity: sensor.dark_sky_dew_point
state_text: 1
icon15:
title: Hourly Summary
widget_type: sensor
entity: sensor.dark_sky_hourly_summary
state_text: 1
icon16:
title: Dark Sky
widget_type: sensor
entity: sensor.dark_sky_icon
state_text: 1
icon17:
title: Minute Summary
widget_type: sensor
entity: sensor.dark_sky_minutely_summary
state_text: 1
icon18:
title: Overnight Low App
widget_type: sensor
entity: sensor.dark_sky_overnight_low_apparent_temperature
state_text: 1
icon19:
title: Overnight Low
widget_type: sensor
entity: sensor.dark_sky_overnight_low_temperature
state_text: 1
icon20:
title: Ozone
widget_type: sensor
entity: sensor.dark_sky_ozone
state_text: 1
icon21:
title: Rain Intensity
widget_type: sensor
entity: sensor.dark_sky_precip_intensity
state_text: 1
icon22:
title: Rain Probability
widget_type: sensor
entity: sensor.dark_sky_precip_probability
state_text: 1
icon24:
title: Visibility
widget_type: sensor
entity: sensor.dark_sky_visibility
state_text: 1
-
Ok, thanks. I see you're using darksky for your sensors. I'm curious to see how you did the automation. You mentioned you are using sunrise/sunset with the darksky sensors to automate lights. I'm automating some lights based on sun elevation but wanted to add in cloud cover. I have a room that needs lights during the day if it's partly to mostly cloudy. So I'm curious how you did your automation for that.
-
Use this entity to determine your cloud coverage entity: sensor.dark_sky_minutely_summary
Returns simple cloud coverage in plain English you can include in your automation. Currently my output is partly cloudy for the hour.
-
You could also try this for a generic approach
automation:
- alias: 'Rainy Day'
trigger:
- platform: state
entity_id: sensor.precip_intensity
to: 'rain'
condition:
- condition: state
entity_id: group.all_devices
state: 'home'
- condition: time
after: '14:00'
before: '23:00'
action:
service: light.turn_on
entity_id: light.couch_lamp
-
Thanks for that. I actually went a different route using a template sensor to determine if indoor lights need to be turned on. It uses the sun elevation and darksky cloud coverage sensors. Here is the code.
- platform: template
sensors:
need_indoor_lights:
friendly_name: 'Need Indoor Lights'
value_template: >
{% if (states.sun.sun.attributes.elevation | int < 22) %}true
{% elif ( (states.sun.sun.attributes.elevation | int < 40) and (states.sensor.dark_sky_cloud_coverage.state | int > 30)) %}true
{% elif (states.sensor.dark_sky_cloud_coverage.state | int > 50) %}true
{% elif ( states.sensor.need_indoor_lights.state == 'true' and ((as_timestamp(now()) - as_timestamp(states.sensor.need_indoor_lights.last_changed)) | float < 1200)) %}true
{% else %}false
{% endif %}
This sensor turns true under the following conditions.
If the sun elevation is below 22 then true.
or if the sun elevation is below 40 and cloud coverage is above 30% then true.
or if cloud coverage is above 50% then true.
The timestamp statement may not be needed. I just included it from the example I found. It was put in to offer a buffer for times when the statements are close to keep the lights from turning on and off. I'm only using it to turn lights on, not off.
I use the sensor as a trigger in one automation with a condition of someone home. I use it again as a condition when the front door opens and someone is arriving home in case the lights are off because no one was home when it triggered the other automation.
-
Yes the automation scripting is very powerful and varied so there's so many ways available to come at it. The extensive documentation and the active community input is what makes this product. Once HA has identified the states it's fairly straightforward from there.
You can have your setup as simple or as complex as you choose depending on your level of experience. There appears to be a platform for every element of hardware that you throw at it.
I have all the basics set up at this stage so I'm going to spend the winter months integrating my current setup under the HA roof and develop a lot more scripts for it. X10 is functioning nicely with it now.