Page 1 of 1

Create virtual hardware

Posted: Monday 15 February 2016 17:31
by BBI_home
In the Domoticz API/JSON documentation:

https://www.domoticz.com/wiki/Domoticz_ ... 7s#Counter

there is a command to create virtual hardware:

/json.htm?type=command&param=addhardware&htype=15&port=1&name=Sensors1&enabled=true

Is there a reason to use type=15 or are other types possible and is a list available with alternatives in order to create other types of hardware like general etc.

Re: Create virtual hardware

Posted: Monday 15 February 2016 19:10
by paulvha
Type 15 = dummy hardware layer. In the GUI this is like adding it manually. If you have the sources look at RFXnames.h in main for the list of htypes (~67 these days) A number of other htypes looks to be supported with this Json command: look at webServer.cpp:: Cmd_AddHardware. I have no experience with handling other htype hardware. Dummy works great :-)

Re: Create virtual hardware

Posted: Monday 15 February 2016 19:17
by gizmocuz
Just create the hardware via the hardware page (dummy) and not via the json call... much easier

Re: Create virtual hardware

Posted: Monday 15 February 2016 19:29
by BBI_home
And the next step in order to create a Plugwise device with Lan interface, is that also possible to do in a similar way?

Re: Create virtual hardware + device

Posted: Tuesday 16 February 2016 12:54
by BBI_home
Hi,

I’m a little bit confused about how to setup a hardware and device to connect a Plugwise Smile and Stretch to my Domoticz server.
In order to do this I can setup a dummy device or I can add new hardware as P1 Smart Meter with LAN interface and complete this with IP and port. So far so good.

The next step is to setup/correct the settings of a device. By creating a dummy device there is no new device created, by adding a new P1 Smart Meter LAN hardware a temp+humidity device is created.

Both are wrong because I like to monitor my energy consumption.

My question is how the change my device settings like type to general and subtype to kWh and m3 etc.

Re: Create virtual hardware

Posted: Tuesday 16 February 2016 13:00
by RayAmsterdam
Search the forum on how to setup Plugwise. It isn't supported by Domoticz directly.

Re: Create virtual hardware

Posted: Tuesday 16 February 2016 14:45
by BBI_home
This has basically nothing to do with a setup of Plugwise itself. It is a the way to setup in general new dummy hardware and needed and correct device in Domoticz what troubles me .

Re: Create virtual hardware

Posted: Tuesday 16 February 2016 17:25
by RayAmsterdam
I meant how to setup Plugwise within Domoticz. There are several threads about this subject. Dummy hardware has nothing to do with Plugwise (and wont work), neither has the P1 hardware in Domoticz.

Re: Create virtual hardware

Posted: Thursday 25 February 2016 11:05
by BBI_home
I'm created a dummy hardware with a device. I can see that the data is displayed as data in the list.
Schermafbeelding 2016-02-25 om 10.36.36.png
Schermafbeelding 2016-02-25 om 10.36.36.png (32.34 KiB) Viewed 8140 times
In utility the data is displayed only in small characters in the second line and in my dashboard not at all.
Schermafbeelding 2016-02-25 om 10.35.47.png
Schermafbeelding 2016-02-25 om 10.35.47.png (27.65 KiB) Viewed 8140 times
Schermafbeelding 2016-02-25 om 10.46.08.png
Schermafbeelding 2016-02-25 om 10.46.08.png (24.22 KiB) Viewed 8140 times
I've tried a lot of differed hardware settings, P1 Smart Meter, RFX Meter, General, etc, but without results and I'm looking for suggestions

Re: Create virtual hardware

Posted: Thursday 25 February 2016 12:34
by paulvha
I have done the same. I update the gas (and electricity) values with a separate daemon. I already made an interface to collect the P1 values and store that in an Access database. I want to keep that for now, hence i did not use P1 hardware interface in Domoticz.
Where it shows 35.036 for you, it shows my gasmeter value and where it shows 0.000m3 for you it will show the delta to the previous reading (calculated in Domoticz).

You may have a brand new gasmeter, but your value looks low to me. My value is 2200.863. Are you sending your gasmeter values as a float ?

I have attached the daemon (written in Python) and documentation as it might help you. The deamon takes input from a file and has flexible configuration options for the information to parse (often needed to capture the gas information).

regards,
Paul

Re: Create virtual hardware - kWh instead of Watt

Posted: Tuesday 08 March 2016 19:42
by BBI_home
Thanks, almost everything is now working fine. :D

The only thing I like is to change is the text : "Watt" into "kWh" for a regular Usage type device with Electric subtype
(I use these settings because this gives me the overall and correct information from my P1 Smart Meter and no daily incemental data.)

Is it possible to change the text in the DB directly of with a JSON command?

Unfortunately /json.htm?type=command&param=getuservariables gives no list of values neither does
/json.htm?type=command&param=getuservariable&idx=IDX

Just
{
status: "OK",
title: "GetUserVariable"
}