daniel-jong / esp8266_p1meter

DSMR5 P1 meter to mqtt using esp8266
GNU General Public License v3.0
145 stars 54 forks source link

Multiple suggestions #8

Open qistoph opened 3 years ago

qistoph commented 3 years ago

Thanks for you work on the project. Some changes that I've made to suit my situation and preferences might be of interest to others. Not looking for another fork to be maintained, I'm hoping you'll consider merging these.

If there's anything that you'd like to see changed in the PR, I'd be happy to consider and discuss.

Commit messages should speak for themselves, though here's some of my rationale and considerations.

Nicer format incoming messages

New

> 0-1:24.1.0(003)
> 0-1:96.1.0(4730303738353635353835313536393230)
> 0-1:24.2.1(210710085509S)(00086.575*m3)
> !0663

Old

0-1:24.1.0(003)

0-1:96.1.0(4730303738353635353835313536393230)

0-1:24.2.1(210710085509S)(00086.575*m3)

!0663

Start reading immediately after boot

Instead of waiting UPDATE_INTERVAL start reading the P1 data immediately after boot. This is especially handy while testing.

Move println next to action

Easy to understand, non-functional change to make the next one more easy to understand in the diff.

Make RX inversion configurable

My hardware was already built based on other projects online and uses a transistor to invert the serial signal. This change accommodates for such devices, while keeping the default unchanged.

Set hostname for DHCP requests

Setting the host name on WiFi includes it in DHCP requests enabling dynamic DNS updates.