Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

light_lux #25

Closed
gabrieledaltoe opened this issue Nov 2, 2021 · 16 comments
Closed

light_lux #25

gabrieledaltoe opened this issue Nov 2, 2021 · 16 comments

Comments

@gabrieledaltoe
Copy link

gabrieledaltoe commented Nov 2, 2021

rtl_433_mqtt_autodiscovery

Published Fineoffset-WH65B/59: battery_ok, temperature_C, humidity, wind_dir_deg, wind_avg_m_s, wind_max_m_s, rain_mm, uv
Skipped Fineoffset-WH65B/59: uvi, light_lux

Here MQTT-EXPLORER:
{"time":"2021-11-02 11:52:26","model":"Fineoffset-WH65B","id":59,"battery_ok":1,"temperature_C":14.7,"humidity":72,"wind_dir_deg":196,"wind_avg_m_s":2.10375,"wind_max_m_s":2.55,"rain_mm":6316.72607,"uv":1188,"uvi":2,"light_lux":45012.0,"mic":"CRC"}

can you update script to look "light_lux" ?

@GeorgeIoak
Copy link

+1, looks like the script is expecting lux to be formatted as lux when RTL_433 sends light_lux. Here's from my unit:

{"time":"2022-01-01 17:52:41",
"model":"Cotech-367959",
"id":209,
"battery_ok":1,
"temperature_C":5.38889,
"humidity":69,
"rain_mm":333.89999,
"wind_dir_deg":359,
"wind_avg_m_s":0,
"wind_max_m_s":0,
"light_lux":0,
"uv":0,
"mic":"CRC"}

It's currently at night which is why the value is 0

@GeorgeIoak
Copy link

I went into the container and modified rtl_433_mqtt_hass.py from

    "lux": {
        "device_type": "sensor",
        "object_suffix": "lux",
        "config": {
            "name": "Outside Luminancee",
            "unit_of_measurement": "lux",
            "value_template": "{{ value|int }}"
        }
    },

to:

    "light_lux": {

I confirmed that this worked to bring in the lux values from the weather station. I think my manual changes in the container will get wiped out with a HA restart so this should be changed.

I can do a PR if that makes it easier to update the code @pbkhrv

@deviantintegral
Copy link
Collaborator

@GeorgeIoak can you file a PR up at https://github.com/merbanan/rtl_433/ ? That's where this file originally comes from.

@GeorgeIoak
Copy link

PR has been submitted

@GeorgeIoak
Copy link

and successfully merged, merbanan/rtl_433#1930

@deviantintegral deviantintegral added this to the Next Release milestone Jan 12, 2022
@GeorgeIoak
Copy link

Just curious how this process works. I see the changes made back at rtl_433 but they haven't issued a new release. Looks like you checkout specific releases and don't use the latest repo so does this mean this change won't hit until rtl_433 issues a new release and then you'll have to issue a new release as well?

@deviantintegral
Copy link
Collaborator

There's been enough interest in newly merged features and bug fixes that I'm thinking of changing from tracking tags, to tracking specific commits on the upstream master branch.

Or... I just realized, nothing stops us from building two or more copies of rtl_433 and then adding a configuration option to choose the version. The default would be the last tag, and the latest would be whatever version is on master at the time. I'll file an issue for that!

@glendower
Copy link

I still have this problem and I installed the two RTL_433 files a couple of days ago.

Published Cotech-367959/72: time, battery_ok, temperature_F, humidity, rain_mm, wind_dir_deg, wind_avg_m_s, wind_max_m_s, uv
Skipped Cotech-367959/72: light_lux

I also have problems with CurrentCost devices

Published CurrentCost-TX/849: time
Skipped CurrentCost-TX/849: power0_W, power1_W, power2_W

and my other weather station Fineoffset

Published Fineoffset-WHx080/0/122: time, battery_ok, temperature_C, humidity, wind_dir_deg, wind_avg_km_h, rain_mm
Skipped Fineoffset-WHx080/0/122: wind_max_km_h

How can I fix these problems ?

@GeorgeIoak
Copy link

The fix is in place back in the rtl_433 repo but this add on pulls a specific release. You can manually make a change now to pull the latest rtl_433 repo or wait until @deviantintegral makes some changes so his code allows tracking from commits.

@glendower
Copy link

Thankyou, how do I do that ?

@GeorgeIoak
Copy link

Probably the easiest would be to fork this repo and then edit the lux definition

Then you can add your own repo to HACS

The other option is to go into the container running this and edit the same file. The downside to do doing that is the change isn't permanent since a restart of HA will recreate the container pulling the source from here

@glendower
Copy link

I did try to do this before I posted but had no idea how to do it.

Having looked up the meaning of 'fork' I have managed to edit the rtl_433_mqtt_hass.py file but no idea what to do next.

Can you give a few pointers on how I proceed after the edits ?

@GeorgeIoak
Copy link

So I assume that you forked this repo and made the changes in your forked repo. Now you just go back and install just like you did for this repo but instead of using the URL for this repo you use the URL for your repo. You can leave this repo installed but just stop it in HA by going to the Add-on page, click on the repo tile and then click on stop.

@glendower
Copy link

Thankyou so much for your help and patience

Lux is coming through loud and strong, This has taken my knowledge base to a whole new level and I feel able to tackle the other two issues, Currentcost power and wind max on the fineoffset weather station.

The problem of UTC time I'll leave for another day.

Thanks again

@GeorgeIoak
Copy link

Glad you got it straightened out, good job!

@deviantintegral
Copy link
Collaborator

We're currently pulling in a near-latest commit from master for rtl_433. The next release will fix this specific issue, and it's been merged into the next branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants