Closed adocampo closed 2 years ago
Hello, which version of HA and which language in Mycroft you use?
Could You update to latest version of skill, add log and send me its output.
sensor_unit = unit_measurement.get('unit_measure') or ''
sensor_name = unit_measurement['name']
sensor_state = unit_measurement['state']
self.log.debug("Unit: %s" % sensor_unit)
self.log.debug("Name: %s" % sensor_name)
self.log.debug("State: %s" % sensor_state)
I'm still using Mycroft on English yet my HA devices are in Spanish. I'm making the tests through Mycroft debug by typing the queries, so all HA queries to switches for instance, are working, but asking for temperature of my sensors doesn't.
version | core-2021.2.2 |
---|---|
installation_type | Home Assistant Container |
dev | false |
hassio | false |
docker | true |
virtualenv | false |
python_version | 3.8.7 |
os_name | Linux |
os_version | 5.10.5-arch1-1 |
arch | x86_64 |
timezone | Europe/Madrid |
Regarding updating the skill, I went to /opt/mycroft/skills/skill-homeassistant
and git pulled, but it said everything was up-to-date.
I don't know what to do with the code you gave me, it seems it's python, but I don't know what to do with that. I will be glad to do it if you explain what I need to do with that.
Just for your information, when I set the temperature on the thermostat, it works, yet the acknowledgment message shows a mysterious "None", but getting that value, it fails
Regarding None in the acknowledgment message, it means that HA did not return a unit of value. Do you have a units visible in HA? Post me a screen of thermostat, please.
The big number is the current temperature while the smaller one is the target temperature, so yes, it doesn't show the unit
Ok, I will simulate it on my setup tonight and try to write a fix.
Nice, and regarding this code?
sensor_unit = unit_measurement.get('unit_measure') or ''
sensor_name = unit_measurement['name']
sensor_state = unit_measurement['state']
self.log.debug("Unit: %s" % sensor_unit)
self.log.debug("Name: %s" % sensor_name)
self.log.debug("State: %s" % sensor_state)
Can I do something to help? If you explain to me what I need to do, I'll be glad to help
Not needed, it is only for printing values that HA return back to Mycroft. We know that problem is with sensor_unit
.
sensor_unit = unit_measurement.get('unit_measure') or ''
mean that if returned value is None (dimensionless) it should be filled with a empty string, so you won't get None in response. I have one real and one dummy thermostat so I can simulate it. When I get back from work, I will test it, if I can not simulate it, I will ask you for more details (with step by step).
When setting a desired temperature, HA wont send back a units.
We can ask HA developers to add units to their api.
Also if unit value unit is not found it would be better to change unit_measur = None
to "<empty string>"
so we do not hear None from Mycroft.
For sensor its same. Current sensor accept only sensor and switch category.
ha_entity = self._find_entity(entity, ['sensor', 'switch'])
We could add climate but problem is that sensor intent return only one value. So with climate it would return only state and not actual or set temperature. Maybe It would be better to write new intent for it.
When You ask about state of climate, what would You prefer as response? I think about something like:
<entity name> is currently turned off.
<entity name> is currently turned on, set to 20 and actual temperature is 22.
The On/off status can be stated if you try to set a temperature, if it's off you can't set any temperature (you must first turn it on).
When I ask for the temperature, I want to know the current one. Ideally we should be able to ask both the current temperature and the target temperature (and why not, if the thermostat is on or off), so it should answer for the three questions for separate.
If I need to choose between just one option, I think the <entity name> is currently turned on, set to 20 and current temperature is 22.
is the best one, but I think it's too long when we usually just want to know the current temperature, and then set the temperature accordingly.
@adocampo Hi, sorry for delay. Lets begin slowly. Could you test this branch https://github.com/Tony763/mycroft-homeassistant/tree/issue65 ?
This should fix case, when no unit is returned from HA. Mycroft should not tell None.
I have the same issue with the latest version of mycroft and the home assistant skill. I am using german as language:
File "/opt/mycroft/mycroft/skills/mycroft_skill/event_container.py", line 73, in wrapper
handler(message)
File "/opt/mycroft/skills/homeassistant.mycroftai/__init__.py", line 185, in handle_sensor_intent
self._handle_sensor(message)
File "/opt/mycroft/skills/homeassistant.mycroftai/__init__.py", line 487, in _handle_sensor
quantity.uncertainty <= 0.5):
TypeError: '<=' not supported between instances of 'NoneType' and 'float'
Hi @pfefferle just to be sure, is it a latest skill version from marketplace or from this repo?
@Tony763 from this repo
Hi @pfefferle , this one https://github.com/Tony763/mycroft-homeassistant/tree/issue65 ?
yes, I also changed line 128 to return "", but this didn't work out either.
@Tony763 I should have given this feedback before proposing another fix! sorry about that :(
@Tony763 I should have given this feedback before proposing another fix! sorry about that :(
No problem, not blaming you :slightly_smiling_face: Sorry if i sounded bad.
yes, I also changed line 128 to return "", but this didn't work out either.
If changing line 116 and 128 did not help, problem must be some elsewhere. This piece of code was not used in past versions as quantulum3 was not in requirements. I will open it in debug once again and check. NoneType error should not occur.
Describe the bug Cannot obtain values from my Thermostat. I saw the vocab sentences and told mycroft to tell me the values of the current temperature, but it fails
To Reproduce Steps to reproduce the behavior:
<ENTITY NAME>
"<ENTITY NAME>
"Expected behavior It should read aloud the current temperature
Log files
Environment (please complete the following information):