Greetings from Denmark.
I am tinkering around with my floorplan for my iphone 11 max pro screen:
And now the time has come for a weather forecast configuration:
I want to store data in an input_number from a sensor.
(Later on in my floorplan config:
This data is being used to compaire a xiaomi realtime sensor data to data form three hours ago stored in an input_number. the two icons on the picture and the green arrow will change according to Realtime data and data from 8 hours ago)
I think that i have almost got it, but input _number.barometerdatareadings donât change to sensor.pressure_lumi_158d00022cc292 value
Here are my code . Any suggestionâs how to fix it?
inbut_number in input_number.yaml
in configuration i added input_number.yaml to configuration.yaml like so:
input_number: !include input_number.yaml
## xiaomi aripressure data stored in this input_number.
barometerdatareadings:
name: 'Barometerdata input'
# mode: box
min: 960
max: 1060
step: 0.1
Sensor:
barometerstand:
friendly_name: "Barometric data without decimals"
unit_of_measurement: 'hPa'
value_template: >-
{{ states('sensor.pressure_lumi_158d00022cc292')|int }}
Automation:
The first 3 platform: time is for testing
At a given time i need sensor.barometerstand to pass on its value to input_number.barometerdatareadings
( barometerstand means barometer reading in danish)
{{(states(âsensor.barometerstandâ) |float }} Result type: number 1021
{{ (states(âinput_number.barometerdatareadingsâ)) }} Result type: number 960
The reading I get now is 960 ( min: 960) from input_number configuration
- id: airpressurereadings
alias: air pressure readings every 8 hours
trigger:
- platform: time
at: '19:47:00'
- platform: time
at: '20:00:00'
- platform: time
at: '20:30:00'
- platform: time
at: '08:00:00'
- platform: time
at: '16:00:00'
- platform: time
at: '24:00:00'
action:
- service: input_number.set_value
data_template:
entity_id: input_number.barometerdatareadings
value: "{{(states('sensor.barometerstand')) |float }}"
I need sensor.pressure_lumi_158d00022cc292 from 8 hours ago compared to the realtime sensor.pressure_lumi_158d00022cc292. I am sure it can be done in an automation, but I am not a coding shark, so i came up with the solution to store the sensorvalue in an input_number. Then I will make another sensor that compares the two values and give me new senson.
The new sensor triggers an input_boolean. This input_boolean goes on and off in the floorplan and will show an icon.
pressure 960 - 1000 = rain icon
pressure 1000 - 1010 cloudy icon
and so onâŚ
You should be aware that the custom of this community is assign the Solution tag to the post that introduces the idea or example that solves the original problem.
In this case, you simply copied what I had suggested and then marked your own post as the Solution. The only thing you changed are the trigger times but that has nothing to do with solving the original problem.
edit:
managed to solve the problem. i had to use Input_Text helper instead of input_number. After that reformat the string from the sensor reading to float. works now
sorry for digging this up but i am having problem w the syntax here it seems
i want to store the current volume level of my AVR in an input number to later restore it, so i am trying to store the sensorâs data in an input number like so: