Smarthome firmware pysmartnode

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
kevinkk525
Posts: 416
Joined: Sat Feb 03, 2018 7:02 pm

Re: Smarthome firmware pysmartnode

Post by kevinkk525 » Mon Oct 01, 2018 1:39 pm

I updated the framework to version 4.0.5 with many improvements over the last versions like:
* RAM usage optimizations, you can now use it on an esp8266 with activated filesystem (although not many components can be registered in this setup before you run out of RAM, more about this in the README)
* new modules (e.g. a modular heater system)
* updated many old modules
* more reliable mqtt connection
* unified access to machine.Pin and machine.ADC between esp8266 (even with nodeMCU pin names) and esp32_LoBo
* more examples and templates to explain how to add configuration and custom components
* multiple bugfixes and improvements especially in receiving a configuration over mqtt and loading components

arrowcircle
Posts: 2
Joined: Thu Nov 01, 2018 8:36 am

Re: Smarthome firmware pysmartnode

Post by arrowcircle » Thu Nov 01, 2018 9:31 am

Hi! Nice idea. Does your project support home assistance autodiscovery?

kevinkk525
Posts: 416
Joined: Sat Feb 03, 2018 7:02 pm

Re: Smarthome firmware pysmartnode

Post by kevinkk525 » Thu Dec 20, 2018 2:59 pm

@arrowcircle: I somehow missed your message, sorry. It does not support home assistance autodiscovery but I always wanted to implement it. Maybe that will follow some day.

kevinkk525
Posts: 416
Joined: Sat Feb 03, 2018 7:02 pm

Re: Smarthome firmware pysmartnode

Post by kevinkk525 » Thu Dec 20, 2018 3:01 pm

The framework is now updated to 4.0.6 but the bigger announcement is, that I had an error in my firmware build for the esp8266 resulting in 16kB less free RAM than I should have. Therefore I wrongly assumed that my framework is running on very low RAM but now I have ~7 active components and still 16kB of free RAM! This is enough for another ~6 sensors and many smaller components.

rowanalex
Posts: 3
Joined: Thu Jan 03, 2019 6:07 am

Re: Smarthome firmware pysmartnode

Post by rowanalex » Thu Jan 03, 2019 6:11 am

This a very useful, thanks! What are your thoughts on adding HTTP support? Do you think the existing RAM on ESP8266 would be able to support it?

kevinkk525
Posts: 416
Joined: Sat Feb 03, 2018 7:02 pm

Re: Smarthome firmware pysmartnode

Post by kevinkk525 » Thu Jan 03, 2019 6:57 am

What do you mean by HTTP support? Support for pysmartnode sending information to a HTTP server or getting information from pysmartnode using HTTP server on the esp?
As there are more than 10kB RAM left, I'd say that should be enough for a simple HTTP support. Never worked with one though.

kevinkk525
Posts: 416
Joined: Sat Feb 03, 2018 7:02 pm

Re: Smarthome firmware pysmartnode

Post by kevinkk525 » Tue Apr 09, 2019 10:05 am

I pushed version 4.1.0 yesterday.

Key changes since my last update on the forum:

* Dropped official support of ESP32_Loboris_Fork because of lack of updates (no commit since 7 months). No code has been removed and modules are even updated to support it so could still mostly work on that fork, I just won't test it on that platform myself.
* Support for mainline ESP32 as all important bugs are finally fixed now
* [ecMeter] added module to measure EC with a simple cable
* [ds18] multiple bugfixes and improvements. Support for instanciating a single DS18 unit
* [ADC] updated to support ESP32 mainline. New interface and subclass logic to support custom ADC classes using external ADCs (like the Arduino). This makes using and implementing the unified ADC interface even easier.
* [Amux] improvements, supports Arduino ADCs & Pins -> possible to connect an AnalogMultiplexer to an Arduino and control remotely
* [ArduinoControl] Added library to control an Arduino by communication by 1-wire protocol

kevinkk525
Posts: 416
Joined: Sat Feb 03, 2018 7:02 pm

Smarthome firmware pysmartnode now with Homeassistant mqtt discovery

Post by kevinkk525 » Sun Jul 07, 2019 6:47 am

Version 5.0.0 now finally supports Homeassistant mqtt discovery!
MQTT discovery: https://www.home-assistant.io/docs/mqtt/discovery/
Pysmartnode release: https://github.com/kevinkk525/pysmartno ... tag/v5.0.0
No more configuring each component inside HASS. It's enough to configure the components you want to use on the device (or the remote configuration server) and HASS will discover them automatically.

Also the unix port is now supported. Its use is limited as it doesn't have a GPIO interface but you can use system calls to execute (almost) anything you like. I use this to control a RF433MHz power switch.

A discovered device in homeassistant could look like this:
hass.JPG
hass.JPG (30.76 KiB) Viewed 68 times


Also a few more changes:
* [MQTT] Integrated Homeassistant mqtt discovery feature
* [COMPONENTS] Completely changed the way components are integrated to support homeassistant mqtt discovery. Every component now has to use a common base component class. This is a major change breaking compatibility with previous pysmartnode/components versions and often component configurations.
* [COMPONENTS, MQTT] Mqtt subscriptions are not callback based anymore but component based. But within a component they are callback based.
* [COMPONENTS] Updated most components accordingly. Some topics and configurations have changed, check your configs! Not updated components were moved to _dev as they need more looking at.
* [Templates] Updated templates.
* [RAM] component is now part of a basic system component.
* [DS18] Component completely rewritten. It is now fully separated into a controller and a unit object. The controller has control over the onewire bus and reads all configured units. (Having other onewire devices on the same bus should be possible. No common onewire controller integrated at the moment). The DS18 unit object supports homeassistant discovery and therefore every DS18 unit connected to the controller has to be configured, unless auto-discovery is enabled on the controller, which will just create an object for each found sensor (this however makes using these in other components impossible and only serves to publish read temperatures).
* [UNIX] Added support for unix port of Micropython! (Most sensors won't be available as it doesn't have a gpio interface, working on an interface for the Pi). But you can execute system commands and e.g. use the rf433 raspberry-remote library
* [STATS] component now also publishes the wifi signal strength.

Post Reply