Code Monkey home page Code Monkey logo

Comments (6)

jkandasa avatar jkandasa commented on May 28, 2024

@j54n1n

  1. The forecast field is missing its text value and it is showing always 0 instead, like so:
    I think it is related to how you map the MySensors field data types. Here at plugin/gateway/provider/mysensors_v2/constant.go you map it as a float type, but according to the MySensors Protocol 2.x documentation it should be a string of either "stable", "sunny", "cloudy", "unstable", "thunderstorm" or "unknown". Your old v1 controller seems to intercept that correctly and shows for example the sun or the cloud symbol. Do you intent that to do the same also in your new v2?

I do update V_FORECAST as string. That will help to resolve this.
at this time, in v2.0 dashboard we do not have symbol display option. So for now it shows the string only.

To support symbol on dashboard, I have added a request in mycontroller-org/web-console#2

  1. Regarding the data types it seems when the type none is mapped a string can be displayed for a field. For example this is the case for your old v1 style RSSI indicator message:
    So maybe the first point can be partly resolved by changing the type. Furthermore do you intent also reuse your old style RSSI message to let it show at the node status page? Or do you want to support either the MySensors I_SIGNAL_REPORT_REQUEST feature or the NodeManagers signal sensor to show its value at the node status page? In my case the later solution would fit the best because our node is sleeping most of the time without smart sleep to conserve power.

For easy maintenance, I am not going to support this option in V2. However, We can achieve this by using a script, I will update the script soon.
It is good idea to implement MySensors native option to get RSSI. Please create a ticket with details, If have an idea on MySensors native support.

  1. Currently the internal message for the battery percentage is not showing up anywhere. Also there your old v1 controller would show the percentage on the node status page. The MySensors implementation is similar as the NodeManagers SensorSignal solution but it is using an internal message type.
    Did you check it on the node details page? Please let me know if you
    Sure I will check this and report back.

Thanks @j54n1n

from server.

jkandasa avatar jkandasa commented on May 28, 2024

93d3fdb fixes V_FORECAST issue

from server.

jkandasa avatar jkandasa commented on May 28, 2024

@j54n1n I have added an option to display images based on the field value. I believe this can satisfy the forecast status display.
Please let me know if you face a difficultly.

Displaying icon is not implemented yet. mycontroller-org/web-console#2

Widget configuration

Here I have used to display motor status based on a field value. You can adjust the value based on your requirement.

# cat mycontroller.yaml 
...skiped content...
directories:
  data: /mc_home/data
  logs: /mc_home/logs
  tmp: /mc_home/tmp
  secure_share: /mc_home/secure_share 
  insecure_share: /mc_home/insecure_share

# ls mc_home/secure_share/
fan_off.png  fan_on.png

image

from server.

jkandasa avatar jkandasa commented on May 28, 2024

Now supports icon too. details are in mycontroller-org/web-console#2

from server.

jkandasa avatar jkandasa commented on May 28, 2024

@j54n1n
The following script can convert MyController v1 properties into a field in MyController v2.

image

Add this script on the field V_VAR5 (click on Update Javascript)

// script to convert MyController v1 properties in MyController v2
// creates new properties based on the name mentioned here
let key = ""
let parsedValue = ""

if (value.includes("p:rssiAsQty")) {
  key = "rssi_quality"
  parsedValue = value.replace("p:rssiAsQty=", "")

} else if (value.includes("p:ip=")) {
  key = "ip"
  parsedValue = value.replace("p:ip=", "")

} else if (value.includes("p:heap-f=")) {
  key = "heap"
  parsedValue = value.replace("p:heap-f=", "")

} else if (value.includes("p:host=")) {
  key = "hostname"
  parsedValue = value.replace("p:host=", "")

} else if (value.includes("rssi:")) {
  key = "rssi"
  parsedValue = value.replace("rssi:", "").replace("dBm", "").trim()
}

if (key.length == 0) {
  key = "invalid-property"
  parsedValue = value
}



const finalResult = {
  value: value,
  labels: {
    controlled_by: "custom_script"
  },
  metricTypes: {
    rssi_quality: "gauge_float",
    ip: "none",
    heap: "gauge",
    hostname: "none",
    rssi: "gauge"
  },
}

// console.log("key:", key, ", Value:", parsedValue, ", ORG:", value)

finalResult[key] = parsedValue
result = finalResult

Result:
image

from server.

jkandasa avatar jkandasa commented on May 28, 2024

@j54n1n I believe I addressed all the requests and closing this issue.
If you feel something missing, kindly reopen with the details. Thanks!

from server.

Related Issues (12)

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.