Comments (6)
same
from hass_openwrt.
Same question
from hass_openwrt.
Hey,
Can I possibly parse the output from openwrt.exec command to a sensor?
In theory - yes. But it's not implemented. The standard output is available as part of the Ubus call response, but it should be somehow exposed to 3rd-party scripts or automatons.
The easy way - emit Hass event after each openwrt.exec
call with the output and exit code, but you will need to listen to that event using Hass automation, parse the output and update one of your helper sensors for that.
Another approach - add and update custom OpenWrt sensor with output of openwrt.exec
response. With this approach, you can create template sensors and parse output. A bit easier to support your custom code (one template sensors vs. helper + automation), but more difficult to support multiple commands
from hass_openwrt.
Considering this integration for monitoring 2 openlumi devices (openwrt in client-wifi mode) with some sensors (lamp, button switch, luminance sensor) and Zigbee router integrated.
Sometimes (after HA restart) related HA entities got stuck with no values and I have to reboot both openlumi devices.
I would like to use the reboot service in automation but also would like to use an uptime sensor.
Would it be possible to explain in more details how to create an uptime sensor in HA (via template sensor in config.yaml), based on the default openwrt configuration?
Thanks in advance
from hass_openwrt.
Would it be possible to explain in more details how to create an uptime sensor in HA (via template sensor in config.yaml)
There's no way, currently. You can exec any program using the service the integration provides, but its standard output isn't available. That should be implemented first
from hass_openwrt.
I would like to know also,
but when I try
service: openwrt.exec
data:
command: system board
target:
device_id: b8c531xxxxxxx84291020
or some variation, I only get permission errors.
openwrt.reboot
works
I think I messed up some permissions, or I don't know what to fill for command.
edit:
sorry,
missed this part
There's no way, currently. You can exec any program using the service the integration provides, but its standard output isn't available. That should be implemented first
still I have some permissions issues, but when I can't get the result, it won't matter
from hass_openwrt.
Related Issues (20)
- OpernWRT 19.07: "ifname" unknown ? HOT 16
- openwrt 22.03 stable release Device [openwrt] async_update_data error: rpc error: 2 HOT 2
- acces denied HOT 2
- OpenWrt 19.07.8 r11364-ef56c85848 - GL iNET GL-MT300N-V2 - async_update_data error: Expecting value: line 1 column 1 (char 0)
- write features aren't working. unable to get reboot switch HOT 5
- Implement ubus system uptime sensor
- help command restart service HOT 7
- Refactor `openwrt.reboot` service into a button entity
- Feature request: expose firewall & port forwarding rules to HA
- permissions ACL file (above) - unclear, which file is meant here HOT 1
- Issues when connecting to router HOT 3
- Setup failed for custom integration openwrt: Unable to import component: cannot import name 'SupportsResponse' from 'homeassistant.core' HOT 4
- Platform forwards should be awaited
- Integration fails to (re-)connect if wifi is disabled
- Adding new Sensors / entities - How To
- Please give example how to execute command from HASS HOT 1
- Detected that custom integration 'openwrt' calls async_forward_entry_setup for integration
- WPS switches not available HOT 1
- Support PoE sensor HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hass_openwrt.