RTL_433 to MQTT Bridge and multiprotocol

Hello everyone, I am new to the exciting world of Home Assistan.
I have managed to enter data from my Acurite 5 in 1 weather station with the Add-on RTL_433 to MQTT Bridge, which is configured in protocol 40.
I have two questions to see if they can help me:
1- the values ​​of temperature, humidity and wind direction, it does not show all 3 at the same time, there is always a missing value, then another appears and disappears, it is very strange, apparently the station sends the data not all to the Once, he sends them in 3 different sequences. How could it be done so that the reading remains until the new value arrives?

2- this question has to do with the listening protocol of the RTL_433 to MQTT Bridge, in the case of the Acurite station it works with protocol 40, but what if I want to listen to that protocol and another one, to receive the magnetic sensors that are on the doors and also work on the 433MHz frequency. Can 2 different protocols be received?

thank you very much for your help

Welcome.

You did ask a good question. I have been breaking my head over supporting multiple protocols too.

For your other question, you need to template your sensors. so they keep heir value. If you post your configuration.yaml as code instead of screenshot, I will try to whip up an example.

Read

specially point 11

Oh, post some of the received mqtt messages too.

Thanks Francis for the reply.
I attach the YAML code of my configuration

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate
    language: 'es'

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

frontend:
  themes: !include_dir_merge_named themes

sonoff:
  username: [email protected]
  password: xxxxxxxxx

notify:
  - name: telegram
    platform: telegram
    api_key: xxxxxxxxxxxxxxxxxxxx
    chat_id: xxxxxxxxxxxxx

telegram_bot:
  - platform: polling
    api_key: xxxxxxxxxxxxx
    allowed_chat_ids:
      - xxxxxxxxxxxxx

sensor:
  - platform: mqtt
    name: "Temperatura"
    icon: mdi:temperature-celsius
    value_template: "{{ ((value_json.temperature_F - 32) * 5/9)|round(1) }}"
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"
  - platform: mqtt
    name: "Velocidad del Viento"
    icon: mdi:weather-windy
    unit_of_measurement: 'km/h'
    value_template: "{{ value_json.wind_avg_km_h |round(1)}}"
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"
  - platform: mqtt
    name: "Humedad"
    icon: mdi:water-percent
    unit_of_measurement: '%'
    value_template: "{{ value_json.humidity }}"
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"
  - platform: mqtt
    name: "Dirección del Viento"
    icon: mdi:compass
    unit_of_measurement: 'º'
    value_template: "{{ value_json.wind_dir_deg }}"
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"
  - platform: mqtt
    name: "Agua Caida"
    icon: mdi:weather-pouring
    unit_of_measurement: 'mm'
    value_template: "{{ ((value_json.rain_in )* 25.4)|round(1) }}"
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"
  - platform: mqtt
    name: "Bateria"
    icon: mdi:battery-60
    value_template: "{{ value_json.battery_ok }}"
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"


light:
  - platform: flux_led
    devices:
      192.168.0.30:
        name: Led Jechu

You can try something like this :

sensor:
  - platform: mqtt
    name: "Temperatura"
    icon: mdi:temperature-celsius
    value_template:  >- 
      {% if (value_json.valuetemperature_F | int) >  0 }}
        {{ ((value_json.temperature_F - 32) * 5/9)|round(1) }}
      {% else %}
        {{states('sensor.temperatura') }}
      {% endif %}
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"

Thanks Francis
I tried, but when buying when checking, I get the following error:
what will it be?
Captura de Pantalla 2020-07-06 a la(s) 01.23.12

Can you post the actual message you receive on

homeassistant/sensor/currentcost/Acurite-5n1/3218

It is difficult to test without.

I made some typo’s :

sensor:
  - platform: mqtt
    name: "Temperatura"
    icon: mdi:temperature-celsius
    value_template:  >- 
      {% if (value_json.temperature_F | int) >  0 %}
        {{ ((value_json.temperature_F - 32) * 5/9)|round(1) }}
      {% else %}
        {{states('sensor.temperatura') }}
      {% endif %}
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"

Great it worked,
The temperature is maintained and is not erased waiting for the other reading

How could you do the same with Humidity and wind direction?

Same system.What I’m doing is the following :
if the value is not present in the received json, take the current value from the sensor.

So for wind, it would be :

  - platform: mqtt
    name: "Temperatura"
    icon: mdi:temperature-celsius
    value_template:  >- 
      {% if (value_json.wind_avg_km_h | int) >  0 %}
        {{ value_json.wind_avg_km_h |round(1) }}
      {% else %}
        {{states('sensor.velocidad_del_viento') }}
      {% endif %}
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"

and so for the others.

Francis, it worked there and the values are stable, thanks


sensor:
  - platform: mqtt
    name: "Temperatura"
    icon: mdi:temperature-celsius
    value_template:  >- 
      {% if (value_json.temperature_F | int) >  0 %}
        {{ ((value_json.temperature_F - 32) * 5/9)|round(1) }}
      {% else %}
        {{states('sensor.temperatura') }}
      {% endif %}
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"
  - platform: mqtt
    name: "Velocidad del Viento"
    icon: mdi:weather-windy
    unit_of_measurement: 'km/h'
    value_template: "{{ value_json.wind_avg_km_h |round(1)}}"
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"
  - platform: mqtt
    name: "Humedad"
    icon: mdi:water-percent
    unit_of_measurement: '%'
    value_template:  >- 
      {% if (value_json.humidity | int) >  0 %}
        {{ value_json.humidity }}
      {% else %}
        {{states('sensor.humedad') }}
      {% endif %}
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"
  - platform: mqtt
    name: "Dirección del Viento"
    icon: mdi:compass
    unit_of_measurement: 'º'
    value_template:  >- 
      {% if (value_json.wind_dir_deg | int) >  0 %}
        {{ value_json.wind_dir_deg }}
      {% else %}
        {{states('sensor.direccionviento') }}
      {% endif %}
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"
  - platform: mqtt
    name: "Agua Caida"
    icon: mdi:weather-pouring
    unit_of_measurement: 'mm'
    value_template: "{{ ((value_json.rain_in )* 25.4)|round(1) }}"
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"
  - platform: mqtt
    name: "Bateria"
    icon: mdi:battery-60
    value_template: "{{ value_json.battery_ok }}"
    state_topic: "homeassistant/sensor/currentcost/Acurite-5n1/3218"

I have an additional query, I don’t know if you know how to solve it,

  • How can you see the wind direction with coordinates and not by degrees?
  • My other problem is with the fallen water, where the system indicates 632mm as a result, which corresponds to the total of fallen water since the Acurite was installed. How can you get the fallen water last 24 hours, last week, last month? it will be possible

These data are going to be very useful for the community, since I have searched the web and could not find it

thank you very much

Francis
I have an additional query, I don’t know if you know how to solve it,

  • How can you see the wind direction with coordinates and not by degrees?
  • My other problem is with the fallen water, where the system indicates 632mm as a result, which corresponds to the total of fallen water since the Acurite was installed. How can you get the fallen water last 24 hours, last week, last month? it will be possible

These data are going to be very useful for the community, since I have searched the web and could not find it

thank you very much

For the wind direction, I don’t know. If it is not in the received json from RTL_433, you probably can’t catch it.

For the fallen water, You could probably use the utility meter.It can calculate daily, weekly and monthly totals.

Francis thanks
implement the following code

utility_meter:
  water30:
    name: "Agua Caida - Mes"
    source: sensor.agua_caida
    cycle: monthly
  water7:
    name: "Agua Caida - Semana"
    source: sensor.agua_caida
    cycle: weekly
  water1:
    name: "Agua Caida - 24hrs"
    source: sensor.agua_caida
    cycle: daily

all 3 markers are at zero
you have to wait for some rain to fall to see if it works
Thank you