Giter VIP home page Giter VIP logo

Comments (6)

Asiak3 avatar Asiak3 commented on September 4, 2024 1

same

from hass_openwrt.

kaciker avatar kaciker commented on September 4, 2024

Same question

from hass_openwrt.

kvj avatar kvj commented on September 4, 2024

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.

blackie333 avatar blackie333 commented on September 4, 2024

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.

kvj avatar kvj commented on September 4, 2024

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.

bkbartk avatar bkbartk commented on September 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.