jheling / freeathome

Free@Home component for Home Assistant
103 stars 37 forks source link

Rain is not shown #118

Closed sstadlberger closed 2 years ago

sstadlberger commented 2 years ago

Hi,

I just noticed that the weather station never shows rain. Temperature, lux and wind are shown correctly. The rain is also correctly shown in the free@home app and as far as I can tell it's also in the XML stream:

<?xml version="1.0" encoding="UTF-8"?><project timeStamp="1413612" sessionId="6f7be49c" type="update" mrhaVersion="2.6.4" mrhaBuild="8172"><privileges/><devices><device serialNumber="7EB100001373" domainAddress="E658" state="modified" commissioningState="ready" progress="100"><channels><channel state="modified" i="ch0001" cid="7EB103A2"><inputs/><outputs><dataPoint state="modified" i="odp0000" full="false"><value>1</value></dataPoint></outputs><parameters/><scenes/></channel><channel state="modified" i="ch0002" cid="7EB103C1"><inputs/><outputs><dataPoint state="modified" i="odp0001" full="false"><value>5.98</value></dataPoint></outputs><parameters/><scenes/></channel><channel state="modified" i="ch0003" cid="7EB103E1"><inputs/><outputs><dataPoint state="modified" i="odp0003" full="false"><value>0</value></dataPoint></outputs><parameters/><scenes/></channel></channels><parameters/></device></devices></project>

<?xml version="1.0" encoding="UTF-8"?><project timeStamp="1413613" sessionId="6f7be49c" type="update" mrhaVersion="2.6.4" mrhaBuild="8172"><privileges/><devices><device serialNumber="7EB100001373" domainAddress="E658" state="modified" commissioningState="ready" progress="100"><channels><channel state="modified" i="ch0000" cid="7EB10382"><inputs/><outputs><dataPoint state="modified" i="odp0001" full="false"><value>1.4</value></dataPoint></outputs><parameters/><scenes/></channel></channels><parameters/></device></devices></project>

<?xml version="1.0" encoding="UTF-8"?><project timeStamp="1413614" sessionId="6f7be49c" type="update" mrhaVersion="2.6.4" mrhaBuild="8172"><privileges/><devices><device serialNumber="7EB100001373" domainAddress="E658" state="modified" commissioningState="ready" progress="100"><channels><channel state="modified" i="ch0003" cid="7EB103E1"><inputs/><outputs><dataPoint state="modified" i="odp0001" full="false"><value>0</value></dataPoint></outputs><parameters/><scenes/></channel></channels><parameters/></device></devices></project>

<?xml version="1.0" encoding="UTF-8"?><project timeStamp="1413615" sessionId="6f7be49c" type="update" mrhaVersion="2.6.4" mrhaBuild="8172"><privileges/><devices><device serialNumber="7EB100001373" domainAddress="E658" state="modified" commissioningState="ready" progress="100"><channels><channel state="modified" i="ch0000" cid="7EB10382"><inputs/><outputs><dataPoint state="modified" i="odp0001" full="false"><value>1.4</value></dataPoint></outputs><parameters/><scenes/></channel><channel state="modified" i="ch0002" cid="7EB103C1"><inputs/><outputs><dataPoint state="modified" i="odp0001" full="false"><value>5.74</value></dataPoint></outputs><parameters/><scenes/></channel><channel state="modified" i="ch0003" cid="7EB103E1"><inputs/><outputs><dataPoint state="modified" i="odp0003" full="false"><value>0</value></dataPoint></outputs><parameters/><scenes/></channel></channels><parameters/></device></devices></project>

<?xml version="1.0" encoding="UTF-8"?><project timeStamp="1413616" sessionId="6f7be49c" type="update" mrhaVersion="2.6.4" mrhaBuild="8172"><privileges/><devices><device serialNumber="7EB100001373" domainAddress="E658" state="modified" commissioningState="ready" progress="100"><channels><channel state="modified" i="ch0000" cid="7EB10382"><inputs/><outputs><dataPoint state="modified" i="odp0001" full="false"><value>1.4</value></dataPoint></outputs><parameters/><scenes/></channel></channels><parameters/></device></devices></project>

<?xml version="1.0" encoding="UTF-8"?><project timeStamp="1413617" sessionId="6f7be49c" type="update" mrhaVersion="2.6.4" mrhaBuild="8172"><privileges/><devices><device serialNumber="7EB100001373" domainAddress="E658" state="modified" commissioningState="ready" progress="100"><channels><channel state="modified" i="ch0002" cid="7EB103C1"><inputs/><outputs><dataPoint state="modified" i="odp0001" full="false"><value>5.92</value></dataPoint></outputs><parameters/><scenes/></channel><channel state="modified" i="ch0003" cid="7EB103E1"><inputs/><outputs><dataPoint state="modified" i="odp0001" full="false"><value>0</value></dataPoint><dataPoint state="modified" i="odp0003" full="false"><value>0</value></dataPoint></outputs><parameters/><scenes/></channel></channels><parameters/></device></devices></project>

Is there any further data that I can provide?

Thanks, Stefan

sstadlberger commented 2 years ago

I did some digging and it looks like #101 is the solution to the problem. I changed PID_RAIN_DETECTION to PID_RAIN_ALARM in /custom_components/freeathome/fah/devices/fah_sensor.py. Rain is now correctly shown in Home Assistant.

I'm going to monitor it for a while to see if there are any unintended side effects as I do not fully understand the code base.

Thanks, Stefan

Tho85 commented 2 years ago

Thanks for the detailed report, I've added a PR to fix this: #119

Tho85 commented 2 years ago

This should be fixed now.

sstadlberger commented 2 years ago

Thanks and sorry for the late feedback. Yes, it works great. Thanks again!