nikla
(Niklas)
February 27, 2022, 7:44pm
1
I have one temperature sensor from modbus integration and two sensors from mqtt integration. I would like to have all three in the same histogram graph. Today it looks like this:
The modbus sensor is defined like this:
- name: Nibe
type: tcp
host: <local IP>
port: 502
sensors:
- name: "Utetemperatur (BT1)"
device_class: temperature
state_class: measurement
address: 1
count: 1
slave: 1
precision: 1
input_type: input
scale: 0.1
scan_interval: 60
The two other sensors are defined like this:
- platform: mqtt
name: "Uterum"
state_topic: "Byvallen/28.E99295040000"
unique_id: temperature.uterum
device_class: "temperature"
state_class: measurement
value_template: "{{ value_json.temperature }}"
force_update: true
- platform: mqtt
name: "Växthus 2"
state_topic: "Byvallen/28.78F52F040000"
unique_id: temperature.vathus2
device_class: "temperature"
state_class: measurement
value_template: "{{ value_json.temperature }}"
force_update: true
I assume that I have missed something but I donât understand why they donât end up in the same graph.
Edit: when I hover of the lower graph I realize that I donât have any unit for the measurement. Can that be the problem? I thought I got C by default for all temperature sensors.
Iâm running 2022.2.9 of HA on Home Assistant Blue.
tom_l
February 28, 2022, 2:30am
2
Yes that is the problem.
You need to give the utetemperatur_bt1
sensor a unit_of_measurement: "°C"
.
nikla
(Niklas)
March 1, 2022, 8:59pm
3
I still fail. My config is now
- name: Nibe
type: tcp
host: <local ip>
port: 502
sensors:
- name: "Utetemperatur (BT1)"
device_class: temperature
unit_of_measurement: "°C"
state_class: measurement
address: 1
count: 1
slave: 1
precision: 1
input_type: input
scale: 0.1
scan_interval: 60
I still do not see °C as the unit while hover over the graph.
The sensor is using the modbus integration. Can that be the problem?
nikla
(Niklas)
March 2, 2022, 9:25am
4
When I look at the documentation for modbus integration at Modbus - Home Assistant it says the following:
unit_of_measurement
is an integer. Is it a documentation error or is this generated from the code which creates a problem in the integration?
tom_l
March 2, 2022, 9:46am
5
Itâs not auto-generated. Itâs a typo. Fixed:
home-assistant:current
â tomlut:patch-2
opened 09:45AM - 02 Mar 22 UTC
Correct unit_of_measurement type.
## Proposed change
<!--
Describe the⌠big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
## Type of change
<!--
What types of changes does your PR introduce to our documentation/website?
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR.
-->
- [ ] Spelling, grammar or other readability improvements (`current` branch).
- [x] Adjusted missing or incorrect information in the current documentation (`current` branch).
- [ ] Added documentation for a new integration I'm adding to Home Assistant (`next` branch).
- [ ] I've opened up a PR to add logo's and icons in [Brands repository](https://github.com/home-assistant/brands).
- [ ] Added documentation for a new feature I'm adding to Home Assistant (`next` branch).
- [ ] Removed stale or deprecated documentation.
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- Link to parent pull request in the codebase:
- Link to parent pull request in the Brands repository:
- This PR fixes or closes issue: fixes #
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [x] This PR uses the correct branch, based on one of the following:
- I made a change to the existing documentation and used the `current` branch.
- I made a change that is related to an upcoming version of Home Assistant and used the `next` branch.
- [x] The documentation follows the Home Assistant documentation [standards][].
[standards]: https://developers.home-assistant.io/docs/documenting/standards
nikla
(Niklas)
March 2, 2022, 10:05am
6
That was quick!
My main problem still remains though. Why is the unit not used for the sensor frpm modbus integration?
tom_l
March 2, 2022, 10:24am
7
Assuming that you have restarted Home Assistant after making the changes to the Modbus sensor the only other thing I can think to advise you to do is to clear your browser cache.
nikla
(Niklas)
March 2, 2022, 12:42pm
8
I restarted my HA again, I cleared browser cache, I have tested on different computers and on different browsersâŚ
It still looks the same, there is no unit on the modbus integration temperature.
petro
(Petro)
March 2, 2022, 12:46pm
9
It wonât move to the other graph until the wrong unit of measurement is purged from the system. That can take up to 10 days depending on your recorder setup.
tom_l
March 2, 2022, 12:59pm
10
New measurements should show up with the new unit though.
petro
(Petro)
March 2, 2022, 1:01pm
11
Yes, the entity will have the correct unit, however itâs unclear what OP is looking at. I would wager that heâs still looking at the graphs.
2 Likes
nikla
(Niklas)
March 2, 2022, 7:58pm
12
I created a new modbus sensor with unit_of_measurement
and it worked directly. I assume @petro was correct above.