fredrikbaberg / ha-sensor-sl Goto Github PK
View Code? Open in Web Editor NEWThis project forked from fuffenz/ha-sensor-sl
Home Assistant sensor for sl.se departures
License: Apache License 2.0
This project forked from fuffenz/ha-sensor-sl
Home Assistant sensor for sl.se departures
License: Apache License 2.0
Should have a more graceful crash, which does not take down the entire tab.
The settings do not accept non-nummerical lines such as X busses, C busses etc. Line numbers should be accepted both as text and nummerics.
When following the instructions in the readme, including adding the custom component, I get the following results:
Wed Jan 16 2019 13:43:33 GMT+0100 (Central European Standard Time)
Update for sensor.sl_stureby fails
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
await self.async_device_update()
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/sensor/sl.py", line 158, in update
if self._enabled_sensor is None or sensor_state.state is STATE_ON:
AttributeError: 'NoneType' object has no attribute 'state'
This is my configuration.yaml
# Sensors
sensor:
# Weather prediction
- platform: yr
- platform: sl
name: stureby
ri4key: MyAPIKEY
siteid: 9164
lines: 17, 18, 19
direction: 1
sensor: binary_sensor.test
Add sensor for messages about traffic problems för certain lines as specified in config with a lovelace card for displaying them
Beeing able to controll the lovelace card more in style, such as:
Show error once, and possibly a "success" when it works again.
Show error code for why API call fails
Disable update of sensor based on state. To save API-calls during night etc.
Add demo Lovelace card, to show sensor data.
Should be able to specify intervalls for polling the api due to restrictions, this in contrast to using a binary sensor which could also be usefull
For a site, enable splitting into multiple sensors.
If you choose Odenplan as station and then add line 43 (which is the "Pendel-tåg") you will also get line 4 (the bus) even thou you haven´t stated that. Do you have any fix for this? See attached files that you can see that it shows that next line is number 4 but I have not stated that line in the setup
At the moment only the 2 upcoming departures are being shown. I think it would be a great addition if the sensor could show all the upcoming departures were real time info is available.
A real life example:
My house is a 6-7 minute walk from the train station. If I would use the sensor during rush hours for all trains going north, the 2 departures that are displayed in the current version of the sensor would most likely already have departed before I have a theoretical chance of getting to the station. But if the sensor would have shown all the available real time information then I would have been able to see the trains that I actually would be able to take.
If this feature would be implemented I would think it would be great if there was a sensor attribute added to show how many real time entries are available. That way it would be easier to make some clever scheme for visualizing the traffic information in the UI.
Best regards
Fredrik
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.