Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Extending the test framework #611

Closed
proddy opened this issue Nov 14, 2020 · 3 comments
Closed

Extending the test framework #611

proddy opened this issue Nov 14, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@proddy
Copy link
Collaborator

proddy commented Nov 14, 2020

EMS-ESP always had an offline simulation mode, so compiling and running on a PC without an ESP attached. It's built using the makefile (customized for linux only as it used gcc and GNUmake).

This mode is useful for seeing how telegrams are parsed and which MQTT publish topics would be triggered. It's done via the test command on the console. I've now extended this to the web API so it can also run on the ESP8266/ESP32. So in theory if you power up an ESP (without the EMS bus connected) and issue commands like http://ems-esp/api?device=system&cmd=test&data=boiler it will simulate all the incoming telegrams for a specific boiler. It's useful to testing devices that we don't have to see how they behave in the Web, like solar, mixing, gateway, heatpump units etc

It's only for debugging, so make sure you have the EMSESP_TEST flag set in pio_local.ini like

[common]
debug_flags = -DEMSESP_TEST
@proddy proddy added the enhancement New feature or request label Nov 14, 2020
@proddy
Copy link
Collaborator Author

proddy commented Nov 14, 2020

only problem is that is causes the ESP8266 to crash! so still experimental....

@proddy
Copy link
Collaborator Author

proddy commented Nov 16, 2020

Ok, seems to work on both ESP8266 and ESP32. Some tests are:

http://ems-esp/api?device=system&cmd=test&data=boiler (add a Nefit Trendline boiler)
http://ems-esp/api?device=system&cmd=test&data=thermostat (adds a FW120 thermostat with HC1 - HC3)
http://ems-esp/api?device=system&cmd=test&data=gateway (adds a KM200 and a RC310 thermostat)
http://ems-esp/api?device=system&cmd=test&data=solar (adds a SM100)
http://ems-esp/api?device=system&cmd=test&data=heatpump (adds an Enviline and FW120 thermostat)
http://ems-esp/api?device=system&cmd=test&data=mixer (adds a controller and MM100, MM200, MM100)
http://ems-esp/api?device=system&cmd=test&data=general (adds a Trendline boiler and a CR100 thermostat)
http://ems-esp/api?device=system&cmd=test&data=general2 (adds a GB072 and a RC310 thermostat)

In the console the other tests to be run in standalone mode are:
render, devices, double, unknown, web, fr120, tc100, km, solar200, cr100, rx, tx, poll, cmd, mqtt, offset

@proddy proddy closed this as completed Nov 16, 2020
@proddy
Copy link
Collaborator Author

proddy commented Nov 16, 2020

in 2.1.1b3

proddy added a commit that referenced this issue Nov 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant