Hi All,
I have from
sensor:
- platform: tcp
host: 192.168.2.41
port: 22
payload: PAYLOAD
JSON data for my heat pump:
{
"DevId": "OCOVX825UY",
"DevPin": "GDFM",
"Token": "XXXXX",
"FrameType": "SkzpData",
"TimeStamp": "14-41-25",
"DevStatus": "PRA00010000000",
"Alarms": "0000000000U",
"BoilerTempAct": "1768",
"BoilerTempCmd": "4000",
"DHWTempAct": "3515",
"DHWTempCmd": "3700",
"DHWHist": "200",
"DHWMode": "Still_On",
"DHWPriority": "On",
"UpTime": "0d 19h 5m 35s",
"CH1MixTempCmd": "0",
"CH1MixTempBase": "4000",
"CH1MixTempMin": "2500",
"CH1MixTempMax": "5000",
"CH1MixValueAct": "0",
"CH1MixValueMin": "10",
"CH1MixValueMax": "100",
"CH1MixGain": "10",
"CH1MixPeriod": "20",
"CH1MixActive": "Off",
"CH1RoomTempAct": "1816",
"CH1RoomTempCmd": "2450",
"CH1RoomTempEco": "1900",
"CH1RoomTempCom": "2450",
"CH1RoomHist": "80",
"CH1Mode": "Active",
"CH1RoomMode": "Comfort",
"WeaTempAct": "1826",
"WeaTempStopCH1": "1000",
"WeaCorr": "0",
"DHWDays": "0000000000000000000000000000",
"DHWHours": "111111111111111111111111111111111111111111111111",
"DHWCDays": "1111111000000000000000000000",
"DHWCHours": "100000000000000000000000000000000000000000101010",
"CH1RDays": "0000000000000000000000000000",
"CH1RHours": "333333333333333333333333333333333333333333333333",
"CH2Days": "0000000000000000000000000000",
"CH2Hours": "000000000000000000000000000000000000000000000000",
"DHWCMode": "Stop",
"DHWCAlwaysON": "On",
"DHWCTempON": "4000",
"DHWCWork": "5",
"DHWCBrake": "0",
"DevType": "PCP_V2.08_2021-01-20"
}
After spending hours trying to get this working, I have caved in and decided to ask the experts! I’ve tried searching, but nothing I have found works, and so I am not sure if it is me, or just not possible.
In the template sensor, I tested:
value_template: '{{ value_json.DevId }}'
- not working
I tested
- platform: tcp
host: 192.168.2.41
port: 22
payload: PAYLOAD
- platform: template
sensors:
my_devid_sensor:
friendly_name: Devid
unit_of_measurement: ""
value_template: "{{ states('sensor.tcp_sensor').split(',')[0].split(':')[1] }}"
I have random data
I need read DevStatus, BoilerTempAct, DHWTempAct etc…
Does tcp sensor support value_json?
Any help would be appreciated.