manustar
(Manuel)
October 31, 2022, 8:06am
1
Hi to alla, i have an issue. Tasmota was inegrated in HA and i can see value for ultrasonic sensor. I configure tasmota for send mqtt info but when i activate the sensor in ha i recived “sensor not have a unique id” and this sensor is not aviable.
This my sensor
Now i need convert distance in percent, on tasmota i set rule for this, in ha can i creati manual sensor for them?
nikito7
(nikito7)
October 31, 2022, 9:36pm
2
value_template
- name: "EB1 Frequency"
unique_id: EB1_Frequency
state_topic: "tele/edpbox1/SENSOR"
value_template: >-
{% set x = value_json.EB1.Frequency|float(0) %}
{% if x > 0 %}
{{ x }}
{% endif %}
unit_of_measurement: "Hz"
device_class: frequency
# /config/pkg/water.yaml
#
template:
#
- sensor:
#
- name: T8 Water Level
unique_id: t8_water_level
state: >-
{% set a = 0.40 %}
{% set b = states('sensor.t8_ultrasonic')|float(None) %}
{% if b != None %}
{{ (a - b)|round(2) }}
{% else %}
{{ states('sensor.t8_water_level') }}
{% endif %}
state_class: measurement
device_class: distance
unit_of_measurement: "m"
icon: "mdi:leak"
# EOF
Just examples.
You may need to use filters
too
manustar
(Manuel)
October 31, 2022, 10:27pm
3
Nice, but im not expert for this, this the misure
4cm = 100%
90 cm= 0%
You can help me for create the sensor for view the percent ?
nikito7
(nikito7)
November 1, 2022, 2:43pm
4
It’s more easy do that with esphome
###
- platform: ultrasonic
trigger_pin: 5
echo_pin: 4
name: "${dev} Ultrasonic"
update_interval: 2s
accuracy_decimals: 2
timeout: 1.0m
filters:
- filter_out: nan
- median:
window_size: 5
send_every: 5
send_first_at: 5
- sliding_window_moving_average:
window_size: 5
send_every: 5
###
Still need to add calibrate_linear
Hello,
I’m creating a load cell based scale and would like to calibrate the scale to a known weight via the internal web server or from HA without having to upload new code each time.
From what I understand this would require using either a global variable or reading the value from HA and neither is allowed for a calibrate linear filter.
[Screen Shot 2022-02-15 at 10.41.32 AM]
As you can see in the code below, this global variable is float.
Has anyone been able to use a variable or a sensor…
manustar
(Manuel)
November 3, 2022, 10:03am
5
Ok, but i dont understand the mqtt i ha not able this sensor, i configure tasmota mqtt and send the percent but in ha i recived “sensor not aviable”
manustar
(Manuel)
November 4, 2022, 4:43pm
7
i installed mqtt explorer and see this:
the mqtt sensor on HA is:
and on state i see this:
and tasmota console